In LPRng-3.6.22, I still have a problem with mildly over-aggressive
behavior in checkpc. Specifically, I have a character special file in
many queues (a null device) which I use in conjunction with Netatalk
filtering and printing. When I run checkpc -A [time] -r -Pqueuename, it
removes the null device from inside the queue.
A check in checkpc looks to see if a file is zero length and will then
remove it if it is older than the time set in the A flag, but doesn't
confirm that it is a regular file. The following simple patch will fix
that, and has been checked on Solaris 2.6 (and I at least examined the
man page for stat on Linux and confirmed that it has the s_IFREG and
S_IFMT constants defined):
*** checkpc.c Fri Jul 28 12:19:51 2000
--- checkpc-patched.c Fri Jul 28 11:59:04 2000
***************
*** 326,332 ****
|| !safestrncmp( cf_name,"df",2 )
|| !safestrncmp( cf_name,"temp",4 ) );
if( delta > Age && Remove ){
! if( statb.st_size == 0 ){
if(Verbose)MESSAGE( " file '%s', zero
length file %ld hours old",
cf_name,
(long)((delta+3599)/3600) );
unlink(cf_name);
--- 326,332 ----
|| !safestrncmp( cf_name,"df",2 )
|| !safestrncmp( cf_name,"temp",4 ) );
if( delta > Age && Remove ){
! if( (statb.st_size == 0) && ((statb.st_mode &
S_IFMT) == S_IFREG) ){
if(Verbose)MESSAGE( " file '%s', zero
length file %ld hours old",
cf_name,
(long)((delta+3599)/3600) );
unlink(cf_name);
--
Bill Knox
Senior Operating Systems Programmer/Analyst
The MITRE Corporation
-----------------------------------------------------------------------------
If you need help, send email to [EMAIL PROTECTED] (or lprng-requests
or lprng-digest-requests) with the word 'help' in the body. For the impatient,
to subscribe to a list with name LIST, send mail to [EMAIL PROTECTED]
with: | example:
subscribe LIST <mailaddr> | subscribe lprng-digest [EMAIL PROTECTED]
unsubscribe LIST <mailaddr> | unsubscribe lprng [EMAIL PROTECTED]
If you have major problems, send email to [EMAIL PROTECTED] with the word
LPRNGLIST in the SUBJECT line.
-----------------------------------------------------------------------------