summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog/newsyslog.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>2010-07-23 09:11:47 +0000
committerbrian <brian@FreeBSD.org>2010-07-23 09:11:47 +0000
commitc77452c8de7227230017ce6d96aa4e7c069c7b0f (patch)
tree0eaa61d61131d0d7f8c211f7925327f514f10e7b /usr.sbin/newsyslog/newsyslog.c
parent9712144a3f9fd88e1fdf5d780ef7a89530570711 (diff)
downloadFreeBSD-src-c77452c8de7227230017ce6d96aa4e7c069c7b0f.zip
FreeBSD-src-c77452c8de7227230017ce6d96aa4e7c069c7b0f.tar.gz
Add a -S switch to override the default syslog pid file. This can be useful
if syslogd's -P switch or a syslogd alternative is being used. MFC after: 3 weeks
Diffstat (limited to 'usr.sbin/newsyslog/newsyslog.c')
-rw-r--r--usr.sbin/newsyslog/newsyslog.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index f962482..7ba6cb8 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -206,6 +206,8 @@ char daytime[DAYTIME_LEN]; /* The current time in human readable form,
* used for rotation-tracking messages. */
char hostname[MAXHOSTNAMELEN]; /* hostname */
+const char *path_syslogpid = _PATH_SYSLOGPID;
+
static struct cflist *get_worklist(char **files);
static void parse_file(FILE *cf, struct cflist *work_p, struct cflist *glob_p,
struct conf_entry *defconf_p, struct ilist *inclist);
@@ -655,6 +657,9 @@ parse_args(int argc, char **argv)
rotatereq++;
requestor = strdup(optarg);
break;
+ case 'S':
+ path_syslogpid = optarg;
+ break;
case 'm': /* Used by OpenBSD for "monitor mode" */
default:
usage();
@@ -747,7 +752,7 @@ usage(void)
fprintf(stderr,
"usage: newsyslog [-CFNnrsv] [-a directory] [-d directory] [-f config-file]\n"
- " [-t timefmt ] [ [-R requestor] filename ... ]\n");
+ " [-S pidfile] [-t timefmt ] [ [-R requestor] filename ... ]\n");
exit(1);
}
@@ -1355,7 +1360,7 @@ no_trimat:
working->flags &= ~CE_SIGNALGROUP;
}
if (needroot)
- working->pid_file = strdup(_PATH_SYSLOGPID);
+ working->pid_file = strdup(path_syslogpid);
}
/*
OpenPOWER on IntegriCloud