svn commit: r301927 - stable/9/usr.sbin/newsyslog
Eric van Gyzen
vangyzen at FreeBSD.org
Wed Jun 15 14:12:23 UTC 2016
Author: vangyzen
Date: Wed Jun 15 14:12:22 2016
New Revision: 301927
URL: https://svnweb.freebsd.org/changeset/base/301927
Log:
MFC r301532
newsyslog: Eliminate unnecessary sleep(10) when -R and -s are specified
After going through the signal work list, during which do_sigwork()
is called and essentially does nothing because -s and -R were
specified on the command line, newsyslog will sleep for 10 seconds
as the (verbose) code says: "Pause 10 seconds to allow daemon(s)
to close log file(s)".
However, the man page verbiage for -R (and -s) seems quite clear
that this sleep() is unnecessary because the daemon was expected
to have already closed the log file before calling newsyslog.
PR: 210020
Submitted by: David A. Bright <david_a_bright at dell.com>
Sponsored by: Dell Inc.
Modified:
stable/9/usr.sbin/newsyslog/newsyslog.c
Directory Properties:
stable/9/usr.sbin/newsyslog/ (props changed)
Modified: stable/9/usr.sbin/newsyslog/newsyslog.c
==============================================================================
--- stable/9/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 14:11:49 2016 (r301926)
+++ stable/9/usr.sbin/newsyslog/newsyslog.c Wed Jun 15 14:12:22 2016 (r301927)
@@ -330,13 +330,15 @@ main(int argc, char **argv)
printf("Signal all daemon process(es)...\n");
SLIST_FOREACH(stmp, &swhead, sw_nextp)
do_sigwork(stmp);
- if (noaction)
- printf("\tsleep 10\n");
- else {
- if (verbose)
- printf("Pause 10 seconds to allow daemon(s)"
- " to close log file(s)\n");
- sleep(10);
+ if (!(rotatereq && nosignal)) {
+ if (noaction)
+ printf("\tsleep 10\n");
+ else {
+ if (verbose)
+ printf("Pause 10 seconds to allow "
+ "daemon(s) to close log file(s)\n");
+ sleep(10);
+ }
}
}
/*
More information about the svn-src-stable-9
mailing list