summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog/newsyslog.c
diff options
context:
space:
mode:
authormarkj <markj@FreeBSD.org>2013-01-27 06:02:38 +0000
committermarkj <markj@FreeBSD.org>2013-01-27 06:02:38 +0000
commit6491a8b5991985e7ef0979e248b1f54555b5e997 (patch)
treee5c55c907477f9c837ab5f76439ba38ee95010a8 /usr.sbin/newsyslog/newsyslog.c
parenteb5455fa48e6e07315efde38fa7c532224892515 (diff)
downloadFreeBSD-src-6491a8b5991985e7ef0979e248b1f54555b5e997.zip
FreeBSD-src-6491a8b5991985e7ef0979e248b1f54555b5e997.tar.gz
Ensure that newsyslog -n prints the correct message for a rotation rule
that uses the 'R' flag. Reviewed by: gad Approved by: rstone (co-mentor) MFC after: 1 week
Diffstat (limited to 'usr.sbin/newsyslog/newsyslog.c')
-rw-r--r--usr.sbin/newsyslog/newsyslog.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index 2bfdfd1..dd48dfe 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -1900,10 +1900,15 @@ do_sigwork(struct sigwork_entry *swork)
}
if (noaction) {
- printf("\tkill -%d %d \t\t# %s\n", swork->sw_signum,
- (int)swork->sw_pid, swork->sw_fname);
- if (secs > 0)
- printf("\tsleep %d\n", secs);
+ if (swork->run_cmd)
+ printf("\tsh -c '%s %d'\n", swork->sw_fname,
+ swork->sw_signum);
+ else {
+ printf("\tkill -%d %d \t\t# %s\n", swork->sw_signum,
+ (int)swork->sw_pid, swork->sw_fname);
+ if (secs > 0)
+ printf("\tsleep %d\n", secs);
+ }
return;
}
OpenPOWER on IntegriCloud