2.7. Checking System Installation with checkpc

The checkpc program is used to make sure that the spool directories and files used by LPRng have the correct permissions and are in place. By default, checkpc will check permissions and report if there are any problems. You should run this as root. For example:

    h4: {2} # checkpc
    Warning - No configuration file '/etc/lpd.conf'
    Warning - No lpd only printcap file found in '/etc/lpd_printcap'
    Warning -  ** cannot open '/var/run/lpd.printer' - 'Permission denied'
    Warning -  bad directory - /var/spool/lpd/lp
    Warning -   Printer 'lp' spool dir '/var/spool/lpd/lp' needs fixing


In the above example, checkpc has discovered that the lpd.conf file is missing. This is a serious problem and indicates that the software may be incorrectly installed.

The lpd only printcap message is usually of concern to administrators who wish to use some of LPRng's more exotic configuration options. It is possible to have separate printcap files for client and server programs. This is useful when printcap files get extremely large and cuts down substantially on system management problems.

The permission denied message for /var/run/lpd.printer is serious, as the lpd server uses this as a lock file.

The bad directory message about the spool directory is usually caused by wrong permissions or a missing directory.

The checkpc -f (fix) option causes checkpc to take action to rectify errors. The checkpc -f -V (verbose) option causes the fixup activity to be displayed a well:

    h4: {3} # checkpc -f -V
    Checking for configuration files '/etc/lpd.conf'
      found '/usr/local/etc/lpd.conf', mod 0100644
    Checking for printcap files '/etc/printcap'
      found '/usr/local/etc/printcap', mod 0100644
    Checking for lpd only printcap files '/etc/lpd_printcap'
     DaemonUID 1, DaemonGID 1
    Using Config file '/etc/lpd.conf'
    LPD lockfile '/var/run/lpd.printer'
     Checking directory: '/var/run'
       directory '/var'
       directory '/var/run'
      checking '/var/run/lpd.printer' file
    
    Checking printer 'lp'
     Checking directory: '/var/spool/lp'
       directory '/var'
       directory '/var/spool'
       directory '/var/spool/lp'
      file 'control.lp', zero length file unchanged in 1 hours
      file 'status.lp', zero length file unchanged in 1 hours
      file 'status', zero length file unchanged in 1 hours
      file 'log', zero length file unchanged in 1 hours
      file 'acct', zero length file unchanged in 1 hours
      checking 'control.lp' file
      checking 'status.lp' file
      checking 'status' file
      cleaning 'status' file, 0K bytes: no truncation
      checking 'log' file
      cleaning 'log' file, 0K bytes: no truncation
      checking 'acct' file
      cleaning 'acct' file, 0K bytes: no truncation


checkpc will create the spool directories and any missing files, and fix the permissions of existing files.