Date: Mon, 6 Jun 2016 22:54:08 +0000 (UTC) From: Eric van Gyzen <vangyzen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r301532 - head/usr.sbin/newsyslog Message-ID: <201606062254.u56Ms8MK059043@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vangyzen Date: Mon Jun 6 22:54:08 2016 New Revision: 301532 URL: https://svnweb.freebsd.org/changeset/base/301532 Log: 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@dell.com> MFC after: 1 week Sponsored by: Dell Inc. Differential Revision: https://reviews.freebsd.org/D6727 Modified: head/usr.sbin/newsyslog/newsyslog.c Modified: head/usr.sbin/newsyslog/newsyslog.c ============================================================================== --- head/usr.sbin/newsyslog/newsyslog.c Mon Jun 6 22:51:44 2016 (r301531) +++ head/usr.sbin/newsyslog/newsyslog.c Mon Jun 6 22:54:08 2016 (r301532) @@ -333,13 +333,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); + } } } /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201606062254.u56Ms8MK059043>