R flag in newsyslog works incorrect

From: Ilya A. Arkhipov <ruM1cRO_at_yandex.ru>
Date: Sat, 07 Jul 2012 16:08:18 +0400
Hi All,

Looks as R flag with archiving works incorrect, for example:
root_at_mhome:/tmp/test# less nsl.cfg 
/tmp/test/test.log      micro:wheel     640     20      10      *       BZR     /tmp/test/test.sh
root_at_mhome:/tmp/test# less test.sh 
echo atata

root_at_mhome:/tmp/test# newsyslog -vF -f nsl.cfg 
Processing nsl.cfg
/tmp/test/test.log <20Z>: size (Kb): 1 [10] --> trimming log....
Signal all daemon process(es)...
Run command: /tmp/test/test.sh 1
atata
Pause 10 seconds to allow daemon(s) to close log file(s)
Compress all rotated log file(s)...
newsyslog: log /tmp/test/test.log.0 not compressed because daemon(s) not notified

http://micro.heavennet.ru/patch/newsyslog.patch fix it.

root_at_mhome:/tmp/test# newsyslog -vF -f nsl.cfg 
Processing nsl.cfg
/tmp/test/test.log <20Z>: size (Kb): 68 [10] --> trimming log....
Signal all daemon process(es)...
Run command: /tmp/test/test.sh 1
atata
Pause 10 seconds to allow daemon(s) to close log file(s)
Compress all rotated log file(s)...

Could you please review and fix it.

Thanks in advance!

-- 
With Best Regards,
Ilya A. Arkhipov
--- newsyslog.c_old	2012-07-07 14:49:41.502135608 +0000
+++ newsyslog.c	2012-07-07 14:48:09.425136998 +0000
_at__at_ -1972,7 +1972,7 @@
 	else
 		pgm_name++;
 
-	if (zwork->zw_swork != NULL && zwork->zw_swork->sw_pidok <= 0) {
+	if (zwork->zw_swork != NULL && zwork->zw_swork->sw_pidok <= 0 && !zwork->zw_swork->run_cmd ) {
 		warnx(
 		    "log %s not compressed because daemon(s) not notified",
 		    zwork->zw_fname);
Received on Sat Jul 07 2012 - 10:08:20 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:28 UTC