The Printer Database Directory Hierarchy on System V

Figure 10.2: Linux graphical tool printtool. Linux requires a defined default printer; if a default printer is not explicitly specified by the lp name, the first printer listed in the etcprintcap file becomes the default one. There are also some other Linux syntax−specific issues that we will talk more about in the paragraphs that follow about local and remote printers.

10.2.2 System V Printer Configuration and the Printer Capability Database

We have already mentioned that the System V printing subsystem includes the versatile and powerful administrative command lpadmin, which can be used to manage many printing configuration issues. The lpadmin command configures LP spooling systems to describe printers, classes, and devices. It is used to add and remove printing destinations, change membership in classes, change devices for printers, change printer interface programs, and change the system default destination. However, this does not mean the lpadmin command is a magic solution for any printing need or problem. It is very helpful in defining and setting the printing resources, but the printing configuration must be saved after the initial setting to be available to the system when needed. It is important to understand the lpadmin background — what happens behind the scenes, hidden from users, and even hidden from the system administrators, for successful administration of the System V printing subsystem.

10.2.2.1 The Printer Database Directory Hierarchy on System V

The System V printer capability database is organized differently from BSDs. Instead of a huge single database file the BSD etcprintcap file, in System V there is a printing−related directory hierarchy, or even hierarchies. The core of this hierarchy is the usrspoollp directory or varspoollp, for some flavors and the etclp regardless of the name of the directory, the 234 Let us examine the directory hierarchy. The lpadmin command helps the system administrator handle the printer capability database for different printer models types. Model interface programs are supplied, and installed, with the LP software. These are shell procedures, C programs, or other executable programs that interface between the lpsched daemon and printing devices; using the BSD terminology, they are filters for printing on different printers. The standard LP software should include model programs for existing standard printers; the printer vendors should supply less−common models files. All printer model files reside in the directory usrspoollpmodel. Models should have 644 permission set if owned by lp and bin, or 664 permission if owned by bin and bin. Model file names must not exceed 14 characters. Model programs are important when a new printer is added to the system; the lpadmin command relies on model programs the lpadmin −m option to establish an appropriate interface program for proper future printing on the new printer. Adding new printers could be quite painful without these programs, and could require advanced system administration skills. If only minor modifications are needed, one way around this quandary could be the creation of a new model program by modifying a copy of an existing model. In general, though, it is not easy to deal with model programs this way. Model programs are scripts, i.e., readable ASCII files. Unfortunately, this is not the case with all printing related files; there are a number of binary files that can only be handled with the available LP front−end commands. A brief trip through the usrspoollp hierarchy can provide a better understanding of the System V printing subsystem. Here is an example from the HP−UX platform: ls −F usrspoollp FIFO cmodel interface model qstatus sinterface SCHEDLOCK default log oldlog receive smodel cinterface fonts lpd.log outputq request class info member pstatus seqfile ls −C usrspoollpmodel HPGL1 dumb hp2560 hp2934a laserjet HPGL2 dumbplot hp2563a h p33440a laserjetIIISi HPGL2.cent fonts hp2564b hp33447a paintjet PCL1 hp2225a hp2565a hp3630a postscript PCL2 hp2225d hp2566b hp7440a quietjet PCL3 hp2227a hp2567b hp7475a rmodel PCL4 hp2228a hp256x.cent hp7550a ruggedwriter clustermodel hp2235a hp2631g hp7570a thinkjet colorpro hp2276a hp2684a hp7595a deskjet hp2300–1100L hp2686a hp7596a draftpro hp2300–840L hp2932a hpC1208a Model programs correspond to all printer models that can be attached and used on the system. This does not mean that they all are active. Only certain model files take part in creating other active files named interface files that reside in the directory usrspoollp interface. Interface files are directly involved in the printing process and are important for printers currently in use. In most cases, but not all, these files are direct copies of the corresponding model files. For example: ls −l usrspoollpinterface total 36 −rwxr−xr−x 1 lp lp 18416 Mar 30 14:31 panlaser 235 On Solaris 2.x a majority of the LP related files reside in the varspoollp and etclp directories: ls −l varspoollp total 18 −rw−rw−r−− 1 lp lp 0 Sep 28 09:25 SCHEDLOCK drwxrwxr−x 2 lp lp 512 Apr 4 1995 admins lrwxrwxrwx 1 root root 23 Apr 4 1995 bin − ...... usrliblpbin drwxrwxr−x 4 lp lp 512 Sep 21 15:24 fifos lrwxrwxrwx 1 root root 13 Apr 4 1995 logs − .... lplogs lrwxrwxrwx 1 root root 25 Apr 4 1995 model − ...... usrliblpmodel drwxrwxr−x 3 lp lp 512 Apr 4 1995 requests drwxrwxr−x 2 lp lp 512 May 9 12:20 system lrwxrwxrwx 1 root root 23 Apr 4 1995 temp − varspoollptmpatlas drwx−−x−−x 4 lp lp 512 Apr 4 1995 tmp ls −l etclp total 24 −rw−rw−r−− 1 lp lp 2141 Apr 4 1995 Systems drwxrwxr−x 2 lp lp 512 Apr 4 1995 alerts drwxrwxr−x 2 lp lp 512 Apr 4 1995 classes drwxr−xr−x 2 lp lp 512 Apr 4 1995 fd drwxrwxr−x 2 lp lp 512 Apr 4 1995 forms drwxrwxr−x 2 lp lp 512 May 9 13:09 interfaces lrwxrwxrwx 1 root root 17 Apr 4 1995 logs − .... varlplogs lrwxrwxrwx 1 root root 17 Apr 4 1995 model − usrliblpmodel drwxrwxr−x 2 lp lp 512 May 9 13:09 printers drwxrwxr−x 2 lp lp 512 Apr 4 1995 pwheels 10.2.2.2 Setting the System V Default Printer We should again use the mighty lpadmin command to set a systemwide default printer. The command: lpadmin −d hplj6dp will set the printer named hplj6dp as the default one. Any previously set default printer will no longer be the default, and the new default printer become active. To check a system for the default printer, use the command: lpstat −d The default printer data is stored in the file usrspoollpdefault.

10.2.3 AIX Printing Facilities