Cleaning Out Log Files

The lpsched and requests log files in the /var/lp/logs directory grow as information is appended. The LP print service uses a default cron job to clean out the log files. The lp cron job is located in the /var/spool/cron/crontabs/lp file. The cron job periodically moves the contents of the log files. The contents of log are moved to log.1, and the contents of log.1 are moved to log.2. The contents of log.2 are lost (that is, replaced by the former contents of log.1) when log.2 gets overwritten.

How to Change Frequency of Printer Request Log Rotation

The requests log file on the printer server is rotated weekly rather than daily. You can change the rotation interval back to daily if the printer server is busy.

  1. Become superuser or lp, or assume an equivalent role on the print server.

  2. Set the EDITOR environment variable.

    # EDITOR=vi
    # export EDITOR
    
  3. Edit the lp crontab file.

    # crontab -e lp
    
  4. Change the first line of the file that rotates the requests log files every Sunday (0) to an asterisk (*) for daily rotation:

    13 3 * * * cd /var/lp/logs; if [ -f requests ]; then if
    [ -f requests.1 ]; then /bin/mv requests.1 requests.2; fi; /usr/bin/cp 
    requests requests.1; >requests; fi
  5. Save the file and exit.

How Local Printing Works

The print request follows the same path it would if the client and server were separate systems. Requests always flow from client to server following the same path.

The following figure shows what happens when a user submits a request to print a PostScript file on a local printer, which is a printer connected to the user's system. The lpsched daemon on the local system does all processing. This processing might include the following:

  • Matching the printer and content type

  • Identifying the default printer, filtering the request

  • Starting the specified printer interface program

The printer interface program does the following:

  • Prints the banner page.

  • Catches printer faults.

  • Determines the printer fault policy to either reset, continue, or begin the print job over again.

  • Finally, the interface program uses the lpcat program to download the print request to the local printer's serial port.

Figure 7.2. The Local Printing Process

The Local Printing Process

How Remote Printing Works

The following figure shows what happens when a user on a Solaris print client submits a print request to an lpd-based print server. The command opens a connection and handles its own communications with the print server directly.

Figure 7.3. Printing Between a Solaris Print Client and a lpd-based Print Server

Printing Between a Solaris Print Client and a lpd-based Print Server

The following figure shows an lpd-based print client submitting a print request to a Solaris print server. The lpd daemon handles the local part of the print request and the connection to the print server. On the print server, the inetd process waits for network printing requests and starts a protocol adaptor to service the request. The protocol adaptor communicates with the lpsched daemon, which processes the request on the print server.

Figure 7.4. Printing Between an lpd-based Print Client and a Solaris Print Server

Printing Between an lpd-based Print Client and a Solaris Print Server

The following figure shows what happens when a user on a Solaris print client submits a print request to a Solaris print server. The print command on the print client handles the local part of each print request by communicating directly with the print server.

The inetd process on the print server monitors network printing requests and starts a protocol adaptor to communicate with the lpsched daemon on the print server, which processes the print request.

Figure 7.5. Printing Between a Solaris Print Client and a Solaris Print Server

Printing Between a Solaris Print Client and a Solaris Print Server