The checkpc (check printcap file) is one of the most useful utilities in the LPRng package.
It will read all the configuration files, printcap files and tests whether devices are set up correctly. Optionally, it will also set the permissions for spool directories and device files. Additionally, it will truncate the accounting and log files to a maximum size. Another use for checkpc is to remove old entries from queue directories.
For a new installation, you will want to run
to set the permissions right. The -f flag instructs the program to correct file permissions. If you don't run this as ROOT, you'll receive a warning about that fact and anychown(2)
calls will (most
likely) fail.
The program reports everything it changes. Since it isn't too clever about some things (visit the man page), you should keep an eye on the output, and run it again if needed. If it keeps failing, change the permissions yourself.
Later, you will want to use checkpc for the daily maintenance of your system. I have this line in user lp's crontab:
This job will:truncate all log and accounting files to 10KB (-t 10K). Actually, it will keep the last 10K from the file, starting on a complete line.
remove all stale files older than three days (-A3 -r).