Unix command-line Release Station client
In a modern Linux environment, the most commonly used print system is usually CUPS. You can configure PaperCut NG/MF 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
lpr. LPR/LPD 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/MF application layer. The PaperCut NG/MF User Client with popup authentication 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 Station queue (see Secure print release 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:
John uses the
lpcommand 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.)
The administrator has enabled the PaperCut NG/MF Release Station on this print queue. The job is placed into a holding state.
John must now authenticate and then release the job. He wants to do this via the command-line Release Station client.
John enters the command
release-print-job. This command was set up by the SysAdmin.
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).
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/MF managed print queues for access via LPR/LPD using various methods. Use the PaperCut NG/MF 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.
Installing the command-line Release Station client
The following installation instructions assume prior Unix system administration experience.
Ensure that Java 1.8 or newer is installed on your system. To check, type
java -versionat 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.
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 Samba (
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
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
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
alias "release-print-job" = \ "/usr/local/papercut/release/pc-release-cmd-line.sh
Users can now release their print jobs by typing
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.