Network & Academic Computing Services
Departamental Computing Support


PLPD Information


plpd is a simple BSD-compatible printsystem, written in python - a "very high level" language suitable for systems programming. As a result, maintenance of plpd has been remarkably low-cost.

plpd allows use of a superset of the BSD system at the socket level, requires/allows no authentication at the host level (although this can easily be done via TCP wrappers), reads in /etc/printcap every time a command is invoked (eliminating the need for lpc restart queue while testing new printers), is inetd-driven (obviating lpc still further - daemons are (re)started on an as-needed basis), and observes a subset of the traditional printcap options. $LPDEST and $PRINTER may be used for default queues, as with the SysV and BSD printsystems (resp.). Errors and diagnostics are logged to /var/adm/lpd-errs, regardless of "lf=".

The command line interfaces are currently...

  • lpc - mostly a no-op, for shell-script compatibility. plpd does a soft "restart" every time someone sends a job to a queue, so "lpc restart queue" is a thing of the past. BTW, you're better off avoiding lpc in BSD-derived printsystems as well - it's quite buggy, and there is nothing you can do with lpc, that you can't do without lpc.

    Mon Jun 11 12:13:32 PDT 2001
    I added "lpc -Pqueue_name" and "lpc -p" today, for dumping the printcap definition for queue_name, and the entire printcap, respectively.

  • lpq and lpstat - check the status of a queue
    • observes "-P" and "-d" (both) for defining a queue
  • lpr and lp - queue a job
    • observes "-P" and "-d" (both) for defining a queue
    • accepts and ignores -c, -s, -J and -p
    • observes "-h" for suppressing the burst page
  • lprm - remove a job from a queue
    • observes "-P" and "-d" (both) for defining a queue

And the printcap options observed, are currently (unknown options are ignored)...

  • lp - defines the device to send jobs to, locally
  • if - defines a script to run; invoked once for each job; /bin/sh command. Note that in the traditional BSD system, this is not /bin/sh syntax, but rather a single, exec'able command - so if you want to be able to move plpd printcap's to BSD systems, don't make full use of plpd's functionality on this
  • sd - defines the spool directory
  • rm - defines a remote host to send jobs to
  • rp - defines the name of the queue on a remote host
  • rg - defines a restricted group, allowed to make use of a print queue. rg is not very secure in the BSD printsystem, and it isn't very secure in plpd - but it still deters unauthorized usage.
  • ultrix - Ultrix is blatantly non-RFC1179 compliant, when it comes to receiving print jobs from another host. This keyword makes plpd send jobs backwards (data file, then control file), so Ultrix can understand them.

Installation:

  • At UCI, autoinstalled suns running Solaris 2.x are configured with plpd by default. No assembly required.
  • Outside UCI, you'd want to add a line like:
      printer stream tcp nowait root /dcs/packages/plpd/lpd lpd
    ...to your /etc/inetd.conf, and then HUP inetd or reboot. Be sure you have these programs on your path before the standard versions. Create symlinks from lpd to lpc, lpq, lprm, lp, lpr, and lpstat. Seriously consider mv'ing the native lpc, lpq, lprm, lpr and lpstat out of the way, and making them symlinks to the plpd symlinks. I recommend ensuring that lpd.py is compiled to lpd.pyc, to speed startup.

Problem resolutions:

  • Most (of the few) plpd problems can be fixed with lpr -Pqueue < /dev/null. This forces the plpd to do a queue sweep. Sending any other file works just as well.
  • On systems with /proc the following problem doesn't exist. On systems without /proc, sometimes a daemon will crash, leaving behind a lock file that prevents other daemons from servicing requests (on a given queue). In such an instance, it may be helpful to rm /var/spool/lpd/queue_name/lock. Solaris 2.x, Irix 5.x & 6.x, OSF/1 3.x and Linux all have /proc available.
  • If you get a "NFS write error" every time you try to print something, that probably means you have plpd mounted on a read-only NFS volume, and python is trying to autocompile plpd.

Bug reports:

    Please feel free to send bug reports to strombrg@uci.edu. I cannot guarantee that I'll have time to look at whatever issues you may raise, but I may, and I definitely want to be aware of what you come across in using plpd.
Bugs:
  • There is no -s option on lpr.




dcs@uci.edu

Network & Academic Computing Services > Support > SysAdmin

Updated: January 8, 2004

University of California, Irvine