Configuring your UNIX or Linux system to print to the ICTprintservice

ICT offers a sophisticated centrally-managed print, scan and copy service and provides support for Windows, Macintosh and ICT-supported Red Hat Linux computers; these pages provide support for the alternative Linux distributions and some versions of UNIX found in the Maths department.

Unlike the single print subsystem used by computers running Microsoft Windows, UNIX and Linux systems use a variety of methods to send information to printers. Many systems still use the 'traditional' BSD lpd (meaning Line Printer Daemon) print spooler while the more recent LPRng (Line Printer, New Generation) emerged a few years ago as a replacement for this and Sun's Solaris has always used a completely different printing system based on lpsched. But after making its debut on Mandrake Linux, CUPS (Common UNIX Printing System) is rapidly becoming the dominant printing subsystem for Linux and is gradually being adopted by some other UNIX vendors as well.

Other printing systems for UNIX/Linux do exist but they are not very common and it is very unlikely your computer will be using one of these specialist systems. These pages will describe setting up systems using lpd, LPRng, CUPS and the Solaris lpsched print system and the initial focus is on taking a generic approach to configuring printing to the ICTprintservice, avoiding for the moment Linux distribution-specific tools or proprietary UNIX vendor's utilities. Armed with the basic information from these pages, you will be well-equipped to set up just about any Linux or UNIX system, including those not specifically discussed here such as Silicon Graphics workstations running IRIX.

In addition, these pages are applicable to setting up any printer with your computer, not just the ICTprintservice mono laser queue, and you may find them useful when setting up other printers but please note that the information and guidance given here applies only to ASCII and PostScript printing; ASCII (or in other words, plain text) and PostScript are the preferred printer formats for UNIX and Linux systems and the ICTprintservice printers support both of these formats as well as the various flavours of PCL (Printer Control Language) which is the preferred format for Windows computers. Configuring UNIX and Linux systems to work with non-PostScript or non-ASCII printers such as the vast majority of inkjet printers and the cheaper laser printers is not covered here as this really has nothing to do with the ICTprintservice. If you do want to configure your system for a different printer (ie, not ICTprintservice printers) then you may find these notes useful.

For completeness, configuring your printing system using vendor-specific tools will be covered at a later date - Red Hat's printtool, SuSE's YaST and YaST2, Tru64's printsetup and Solaris's admintool; many of these special tools are GUI-based and may not look quite the same as in the screenshots on these pages owing to differences in operating system versions and in the X-Windows window manager or desktop environment in use while using the tool.

How do I know which printing system my computer is using?

If you already know which printing subsystem is used on your computer, you can go straight to the appropriate instructions for your particular set-up - CUPS, LPD, LPRng or Solaris.

If you are unsure or don't know which printing system is your computer is using, one way of finding out is to look at the process list and see which print daemon is actually running; the ps -ef command will give you a long listing of running processes on any UNIX or Linux system and filtering the resultant listing through grep to show only the known, expected print spooling processes will show you which print system is currently being used:
ps -ef | grep cupsd     to check for the CUPS print spooler
ps -ef | grep lpd       to check for the lpd print spooler
ps -ef | grep lprng     to check for the LPRng print spooler
ps -ef | grep lpsched   to check for the Solaris lpsched print spooler
Here are some examples - my Linux system is running CUPS:
andy@anahata:~$ ps -ef | grep cupsd | grep -v grep
root      3224     1  0 Jan16 ?        00:00:52 /usr/sbin/cupsd
while checking to see if the lpd print spooler is being used on this system will of course return a null response:
andy@anahata:~$ ps -ef | grep lpd | grep -v grep
as there will only ever be one print spooler in operation.

This Digital/Compaq Alpha is running the lpd spooler:
andy@prandtl> ps -ef | grep lpd | grep -v grep
root        490      1  0.0 17:52:43 ??           0:00.00 /usr/lbin/lpd
while this Solaris system is using lpsched:
andy@netra:~ $ ps -ef | grep lpsched | grep -v grep
    root   214     1  0   Dec 31 ?        0:00 /usr/lib/lpsched
If none of these printing subsystems appears to be in use on your computer then either it has never been set up for printing or a printer service is supposed to be running but is stopped/has been stopped for some reason. If your computer has a vendor-supplied service configuration tool such as Red Hat's chkconfig or SuSE's YaST/YaST2 then you can use this to see if printer services are supposed to be running and start them if need be; Red Hat's printtool will also start or restart a stopped printer subsystem. In the absence of any tools such as these, you will need to know a little more about how your system works, which printing subssytem is normally used on that system and how system services are started and stopped - you may find these notes on starting and stopping system services for the UNIX and Linux variants covered here of some help but if in doubt seek help.

Setting up your print subsystem

Now that you have found out which of the four most common printing systems is running on your computer, follow the links below to set up and test your new print queues.

For systems using CUPS

As CUPS is rapidly becoming the most popular printing subsystem, this will be covered first. Forgetting proprietary utilities like Red Hat's printtool for the moment, there are actually three ways of configuring CUPS - one method is to edit the /etc/cups/printers.conf file using any text editor and add in the definitions for the ICTprintservice queues manually. The alternative method is to use the CUPS administration system, a powerful and comprehensive web-based system which allows you to do much more - this is the recommended technique for most users.

Both of these techniques assume that the CUPS subsystem has already been configured and is already running on your system, with or without configured printers. If CUPS isn't configured on your computer, then you will have to use the lpadmin utility to initially configure CUPS to the point where it can be started. lpadmin can also be used to add new print queues to an existing configuration - this is the third method of adding these and is in fact very similar to adding printers under Solaris.

For systems using LPD

Setting up new print queues manually on systems using the lpd print system is a little bit more involved than the equivalent CUPS manual configuration (one reason CUPS has become so popular) and the prodedure is detailed here. However, if your system has a utility to manage your lpd printers and queues (such as the printtool utility found on Red Hat and Fedora Linux systems, or SuSE's YaST/YaST2 tools) use this instead as it's so much easier.

For systems using LPRng

Instructions on setting up systems using LPRng will follow if there is any demand - although Red Hat switched to LPRng in Red Hat version 7.x, most Linux vendors stayed with LPD until CUPS replaced it while UNIX systems generally continue using the legacy print subsystems as before. And now Red Hat and its derivatives Fedora, CentOS, et al have also moved to CUPS.

For Sun Solaris systems

Not many Sun workstations are in use as desktop systems in the Faculty of Natural Sciences although there may be PCs running Solaris x86 or even OpenSolaris; for the sake of completeness, setting up a permanent ICTprintservice queue on a system running Solaris is described here but it's worth remembering that the Solaris printing subsystem supports redirection of POSIX-style print jobs without requiring any prior installation work or configuration of the system beforehand. You can simply print to the ICTprintservice queue with a command like:
lpr -P "" yourfile

Andy Thomas

UNIX/Linux support,
Faculty of Natural Sciences

last updated: 12.03.2010