You are here: Installation > Installation on Linux (CUPS and Samba) > Unix command-line Release Station client

Unix command-line Release Station client

In a modern Linux environment, the most commonly used print system is usually CUPSCommon User Printing System (CUPS) is a printing system for Unix operating systems that allows a computer to act as a print server. A computer running CUPS is a host that can accept print jobs from client computers, process them, and send them to the appropriate printer.. You can configure PaperCut NG to integrate with CUPS to conveniently track printing. On Legacy Unix systems CUPS is often not an option and printing is performed via the Line Printer tools such as lp or lpr. LPRThe Line Printer Remote protocol (LPR) is a network protocol for submitting print jobs to a remote printer. A server for the LPD/LPR protocol listens for requests on TCP port 515. A request begins with a byte containing the request code, followed by the arguments to the request, and is terminated by an ASCII LF character. An LPD printer is identified by the IP address of the server machine and the queue name on that machine. Many different queue names may exist in one LPD server, with each queue having unique settings. The LPR software is installed on the client device./LPDThe Line Printer Daemon protocol (LPD) is a network protocol for submitting print jobs to a remote printer. A server for the LPD/LPR protocol listens for requests on TCP port 515. A request begins with a byte containing the request code, followed by the arguments to the request, and is terminated by an ASCII LF character. An LPD printer is identified by the IP address of the server machine and the queue name on that machine. Many different queue names may exist in one LPD server, with each queue having unique settings. The LPD software is stored on the printer or print server. is a non-authenticated printing protocol so the identity of the user associated with a print job can't be trusted. Instead, the authentication must be performed at the PaperCut NG application layer. The PaperCut NG User ClientThe User Client tool is an add-on that resides on a user's desktop. It allows users to view their current account balance via a popup window, provides users with the opportunity to confirm what they are about to print, allows users to select shared accounts via a popup, if administrators have granted access to this feature, and displays system messages, such as the "low credit" warning message or print policy popups. with popup authenticationPopup authentication involves matching the source IP address of the print job with the user confirmed to be operating from the popup client IP address. Authentication is provided by the PaperCut NG client software in the form of a popup dialog requesting a username and password. To print with popup authentication the client software must be running on the workstations or laptops. as discussed at Scenario Two: The multi-user Mac with popup authentication is a good option but not appropriate for a terminal-only environment. Terminal-only environments can be supported via a Release StationPrint Release Stations place a print job on hold and allow users to release it when required. Often a Release Station is a dedicated PC terminal located next to the printers, however, Release Stations can take other forms such as a web browser based interface. Some common examples where Release Stations can be used include secure printing, approved printing, and authentication. In a secure printing environment jobs are only printed when the user arrives at the print area and confirms his or her identity. This ensures the user is there to collect the job and other users can't "accidentally" collect the document. In some organizations it may be appropriate to hold jobs until they are approved by selected individuals. A good example would be a teacher approving printing on an expensive color printer. Hold/Release queues can be used as a form of authentication in an unauthenticated environment. Users must authenticate prior to releasing their jobs allowing PaperCut NG to confirm their identity. queue (see Hold/release queues & Print Release Stations for more detail). Jobs held in a Release Station queue are normally accessed and released via a dedicated terminal or a web browser based interface, however, for the benefit of terminal-only users, a command-line job release client is also provided.

This process is best explained using an example:

  1. John uses the lp command to print a Postscript document from his Unix terminal session. The job arrives in the queue under the username identity "john". (Although the name can't be trusted.)

  2. The administrator has enabled the PaperCut NG Release Station on this print queueA print queue displays information about documents that are waiting to be printed, such as the printing status, document owner, and number of pages to print. You can use the print queue to view, pause, resume, restart, and cancel print jobs.. The job is placed into a holding state.

  3. John must now authenticate and then release the job. He wants to do this via the command-line Release Station client.

  4. John enters the command release-print-job. This command was set up by the SysAdmin.

  5. John enters his username and password, confirms the job's name, cost and page count and releases the job for print. The following is an example of the output seen:

    Please enter your username: john

    Please enter your password:

    Current balance: $8.00

    18:04:13 - Name: "Configuring Linux", Pages: 2, Cost: $0.40

    Print this job? [yes]

    Released 1 job(s).

  6. The job prints and John's account is charged.

Enabling the Release Station on a printer is a global option - it affects all jobs from all users. In some environments it might not be appropriate to have all jobs controlled via a Release Station - for example, jobs originating from Windows systems are already authenticated and should print directly. An alternate strategy is to have two queues for the same printer. The first queue does not use the Release Station option and only allows printing from authenticated workstations/users, while the other queue has the Release Station option enabled.

You can expose PaperCut NG managed print queues for access via LPR/LPD using various methods. Use the PaperCut LPD Service when the queues are hosted on a Windows system. An LPD interface is available for CUPS if the queues are hosted on Linux.

Tip:

Windows SysAdmins can control which queues are exposed via LPR/LPD by setting printer permissions. Queues set up to explicitly deny permission to access from the SYSTEM account are not accessible via LPR.

Installing the command-line Release Station client

The following installation instructions assume prior Unix system administration experience.

  1. Ensure that Java 1.8 or newer is installed on your system. To check, type java -version at the terminal. If you do not have Java 8 (1.8) or higher, install it before continuing. Java is available for all major Unix operating systems.

  2. Copy the Release Station files from your primary server to the system for which you want to set up the command line Release Station client. These files are located in [app-path]/release. If your primary server is running Windows, this folder is shared by default (accessible via smb://[server]/release). You can use tools such as SambaSamba is a Windows interoperability suite of programs for Linux and Unix. It is used to integrate Linux/Unix servers and desktops into Active Directory environments. It can function as both a domain controller or as a regular domain member. (smbclient) to help copy these files. Ensure all files in the folder are copied taking care to preserve the existing heirarchy.

    The recommended location to install the Release Station command line client is /usr/local/papercut/release/.

  3. Ensure that the command line Release Station client has execute permissions for all users. Use the following command:

    chmod 755 ./pc-release-cmd-line.sh

  4. For convenience, you can create an alias for the command line Release Station client. This is typically done by entering the following line in a global profiles file, or each user's .profile file:

    alias "release-print-job" = \

    "/usr/local/papercut/release/pc-release-cmd-line.sh

  5. Users can now release their print jobs by typing release-print-job.

You can also create a 'wrapper' for lp to run the command line Release Station client after a user has sent a print job. The following script print-doc provides an example:

#!/bin/sh

echo "Printing document using lpr..."

/usr/bin/lpr "$@"

echo "Printing done, calling program to release job..."

sleep 1

cd /usr/local/papercut/release

./pc-release-cmd-line.sh

echo "Done."

For the convenience of users, install the command line Release Station client on all systems where printing from the terminal can be performed.


Comments

Share your findings and experience with other PaperCut users. Feel free to add comments and suggestions about this Knowledge Base article. Please don't use this for support requests.