Linux Printer Sharing with lpd


The Line Printer Daemon (lpd) provides printer services for local and remote users.   It is an essential service that is started at boot time from a startup script.   On both Red Hat systems, lpd is started by the /etc/rc.d/init.d/lpd script that is generally included in the startup by default, and can be controlled chkconfig or tksysv.


Managing lpd

 

  The Line Printer Control (lpc) program is a tool for controlling the printers and administering the printer queue on lpd printer servers.   below a list of lpc commands used on our Red Hat 7.2 system and above.


active printer[@host] 

   checks to see if the remote printer queue is active

client printer 

   displays the client configuration for the printer

defaultq 

   lists the default queue used by lpc 

defaults 

   list the default configuration settings

down printer message 

   ends spooling and printing, and outputs a message

enable printer 

   enables spooling to a print queue

kill printer 

   aborts and then starts the printer again, like a reset

lpd printer[@host] 

   retrieves the process ID of lpd from the remote host servicing the printer

server printer 

   show's the server printcap entry for the printer

lpq printer [options] 

   Runs lpq

lprm printer job 

   Runs lprm

exit or quit 

   Exits from lpc and will end current session


  Sample statements:


  [root]$ lpc


  lpc> status all 


  lpc> kill lp 

  . . . . .

  . . . .


  lpc> lpq lp 

  . . . . . . .

  . . . .


  lpc> topq lp 840

  . . . . . . .

  . . . .


  lpc> exit


   Note: 

  840 above is the job number, to see the details you need to issue lpq lp command and it will give you details regarding current Rank, owner/ID or class and job numer, files or filename and even the size and time