Text Size: ππππ

CECM Home > About Us > CECM's Printers > SFU_Print on CentOS 7

Awards Computing Facilities Printers Contact Info Employment Photo Galleries Logo Visitor Information

How to use the SFU_Print Queues on CECM CentOS 7 Computers

Table of Contents

1) Command-line printing basics

To see what printers are available, type lpstat -a. The output should look something like this:

 laserwriter accepting requests since Wed 06 Mar 2019 11:33:12 PM PST
 laserwriter-single accepting requests since Wed 06 Mar 2019 11:33:12 PM PST
 lw accepting requests since Wed 06 Mar 2019 11:33:12 PM PST
 lw-single accepting requests since Wed 06 Mar 2019 11:33:12 PM PST
 SFU_Print accepting requests since Thu 07 Mar 2019 03:23:23 PM PST
 SFU_Print-colour accepting requests since Thu 25 Oct 2018 12:55:41 AM PDT
 SFU_Print-colour-single accepting requests since Tue 19 Mar 2019 02:54:14 PM PDT
 SFU_Print-single accepting requests since Thu 25 Oct 2018 12:55:39 AM PDT

To see if there are any stuck print jobs, type lpstat -o. The output might look something like this:

 SFU_Print-colour-single-7 username          302080   Tue 19 Mar 2019 03:22:06 PM PDT
 SFU_Print-8             username          145408   Tue 19 Mar 2019 03:22:51 PM PDT

If a stuck print job belongs to you and you want to get rid of it, you can use the cancel command, as in: cancel SFU_Print-colour-single-7 or cancel SFU_Print-8.

NOTE: Every time you print, you should check the print queues with lpstat -o, and cancel any stuck jobs that you own. If you don't do this, the stuck jobs will sit there, virtually forever. They even persist after reboots! I often find print jobs that have been stuck for weeks or even months! Please cancel your stuck print jobs!

Alternatively, if the print job is stuck because it is awaiting authentication, you can authenticate it.

To print a pdf file, say "topopromo.pdf" to the SFU_Print-colour queue, just type lp -d SFU_Print-colour topopromo.pdf. This will put your print job into the queue. You will then need to authenticate in order to actually print (assuming that you haven't already pre-authenticated using Kerberos).

2) Printing from a GUI application

Although you can print a pdf file from the command-line, you might first want to view it using a graphical application and print it from there. For such purposes, I recommend that you use evince or atril. evince is the GNOME document viewer and atril is the MATE document viewer. Or if you prefer the KDE desktop environment, then you can use okular. They are all open-source and supported by most Linux distributions.

Do not use acroread! If you try to print from acroread to one of the SFU_Print queues, the job will fail and it will remain stuck in the local queue on your computer. If you view the print queue, you'll see that the problem isn't that the job status is "Held for authentication" but, rather, it will be Stopped. This is due to "filter errors". The bottom line is that acroread is not compatible with the SFU_Print drivers.

The problem is that Adobe stopped supporting acroread on Linux many years ago. One hasn't been able to download it for a long time. The installer that I use to put acroread on Fedora Linux and CentOS Linux is a very old one that I snagged way back before Adobe dropped support. It's surprising that it even runs at all.

Whatever GUI application you use for printing, it will have a print menu that most likely comes with tabbed sub-menus for adjusting such things as duplex, colour, and resolution. For example, here's what the evince print menu looks like:

Evince Print Menu

You might be confused, because SFU_Print-colour isn't necessarily colour and SFU_Print-single isn't necessarily single-sided! Those queues names validly represent the printer output only when printing from the command-line, and the settings will be overridden by what you choose in the GUI print menu. Furthermore, whatever you choose for one of the SFU_Print queues will be set for all of them. For example, if you choose single-sided colour printing for one of the SFU_Print queues, say "SFU_Print-colour-single", they will all be set to single-sided colour printing!

In order to avoid confusion, you should "SFU_Print" for all GUI printing, whether it is black and white or colour; single-sided or duplex, and set the options accordingly each time you print.

3) Print job authentication using the GNOME desktop

3a) Print job authentication when printing from the command-line in GNOME

If you are running a GNOME desktop session on a CECM CentOS 7 computer, then, when you print a file on the command-line (in a Terminal window) to one of the SFU_Print queues, you should see a notification similar to the following pop up on your screen:

Printing notification

If you're not using Kerberos pre-authentication, then this will be followed shortly thereafter by the following notification:

Authentication notification

If you click on the latter notification window before it disappears, it will take you to a print job authentication window like the following:

Job Authentication window

You can then hit the Authenticate button, and type in your Campus username and password. NOTE: this is not necessarily the same as your CECM password! The CECM uses its own authentication system which is independent from the Campus auth system.

After successful authentication, the PaperCut App will respond.

If the "Authentication Required" notification disappears before you have a chance to click on it, or if you never saw it in the first place, you can still bring up the Job Authentication window as follows. First, click in the upper right-hand corner of the header of your GNOME desktop in order to bring up the settings menu, which will look something like this:

Settings menu

And then click on the button which has a crossed wrench and screwdriver logo on it (circled in red above), in order to bring up the GNOME Control Center. Scroll through the settings to "Devices" and then click on "Printers". It should look something like this:

Printer Settings

Scroll down to the SFU_Print Queues section. If there is a job sitting in one of the queues, you'll see it listed as shown circled in red below:

Printer Settings 2

Just click on that button (circled in red above) and you'll get the Job Authentication window as shown previously.

3b) Print job authentication when printing from a GUI application in GNOME

If you're printing from a GUI application in GNOME, you'll get a different job authentication window than that shown above. If you're not using Kerberos pre-authentication, then you should see a Job Authentication window similar to the following pop up on your screen:

Job Authentication window

As above, type in your Campus username and password. NOTE: this is not necessarily the same as your CECM password! The CECM uses its own authentication system which is independent from the Campus auth system.

If you click on the "Remember password" box, your Campus password will be saved into your keychain, and you won't have to type it every time you print from a GUI application.

After successful authentication, the PaperCut Client App will respond.

If, for some reason, the Print Job Authentication window doesn't show up its own, you can still bring it up manually, as shown above.

4) The PaperCut Client App

The accounting system used by the SFU_Print queues is called "PaperCut". It keeps track of how many pages you print. The PaperCut Client App talks to the PaperCut server, and it is set to start automatically when you log into a GNOME session on a CECM CentOS 7 computer. It looks like this:

PaperCut Client App

When you successfully authenticate to an SFU_Print queue, the PaperCut Client App will put up a window similar to the following:

PaperCut Client Notification

If you see this window, that means your print job was successful, and that all you have to do is go to the printer and tap your key fob to the sensor in order to release your printing. If you don't have a key fob, you can type in your Campus username and password on the printer's LCD screen.

If you don't see this window, then that most likely means that something went wrong and your job will not reach the printer.

5) Printing without the GNOME desktop

If you are logged into a CECM CentOS 7 server via ssh, then the GNOME desktop won't be available to you. You can still print via the command-line, but authenticating an SFU_Print job presents an extra challenge.

The best way to authenticate your print job is to use Kerberos pre-authentication. Unfortunately, this option is currently broken in CentOS 7 due to a bug in samba.

The second best way to authenticate your print job this is to make sure that you're running X-Windows on your client computer. If you're logged into a GUI desktop (such as MATE or GNOME) of a Linux workstation, then it's already running X-Windows. (The GUI is an environment built on top of X-Windows.)

If you're using a Mac, then make sure you have XQuartz installed.

If you're using Windows, then you need to install MobaXterm.

Then, in a Terminal window of your Linux workstation or Mac, or in a MobaXterm window of your Windows computer, type ssh -X [servername].cecm.sfu.ca, where "[servername]" is the name of one of the CECM CentOS 7 servers, such as gaby, jude, maple, or stan. This will forward X-Windows over your ssh connection.

If you want to verify that X-Windows is working, just type xeyes &. This is a small X-Windows program that displays a pair of eyes that tracks your cursor. It looks like this:

xeyes

In order to authenticate your print job, type system-config-printer &. You'll probably see a bunch of error messages in the Terminal window because you're not running a proper GUI, but it is usually safe to ignore these. You should see a window pop up looking something like this:

Print Settings

Go to the "Printer" menu of this window and select "View Print Queue". If you have a print job being held for authentication, it will look something like this:

Job Held for Auth

Just right-click on your stuck print job and choose "Authenticate" from the pop-up menu:

Authenticate from pop-up menu

You'll need to use your Campus username and password. If you're on a CECM workstation that is running the PaperCut Client App, it will pop up its notification window and you'll know that your print job was successful and is awaiting release at the printer.

Even if you're on a home computer or a laptop that isn't running the PaperCut Client App, it is still possible that your print job was successful. You won't know for sure until you go to the printer to release your job. (But if you leave it for too long, it'll disappear.)

6) Print job pre-authentication with Kerberos

Kerberos printing on CentOS 7 is currently broken due to a bug in the newer versions of samba. When this bug has been fixed, this documentation will be updated.

For more details on this, please see our Kerberos Printing FAQ.


John Hebron
Research Computing Group
IT Services, SFU
Last modified: Wed Apr 10 17:18:15 PDT 2019