Add support for -P pid_file, like FreeBSD syslogd
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
b67d57cf59
commit
fc4840a698
@ -23,6 +23,9 @@ sysklogd \- Linux system logging utilities.
|
|||||||
.I interval
|
.I interval
|
||||||
]
|
]
|
||||||
.RB [ " \-n " ]
|
.RB [ " \-n " ]
|
||||||
|
.RB [ " \-P "
|
||||||
|
.I pid file
|
||||||
|
]
|
||||||
.RB [ " \-p"
|
.RB [ " \-p"
|
||||||
.IB socket
|
.IB socket
|
||||||
]
|
]
|
||||||
@ -154,6 +157,11 @@ Avoid auto-backgrounding. This is needed especially if the
|
|||||||
is started and controlled by
|
is started and controlled by
|
||||||
.BR init (8).
|
.BR init (8).
|
||||||
.TP
|
.TP
|
||||||
|
.BI "\-P " "pid_file"
|
||||||
|
Specify an alternative file in which to store the process ID.
|
||||||
|
The default is
|
||||||
|
.IR /var/run/syslog.pid .
|
||||||
|
.TP
|
||||||
.BI "\-p " "socket"
|
.BI "\-p " "socket"
|
||||||
You can specify an alternative unix domain socket instead of
|
You can specify an alternative unix domain socket instead of
|
||||||
.IR /dev/log "."
|
.IR /dev/log "."
|
||||||
|
@ -342,7 +342,7 @@ int main(int argc, char *argv[])
|
|||||||
funix[i] = -1;
|
funix[i] = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
while ((ch = getopt(argc, argv, "46Aa:dhHf:l:m:np:R:rs:v?")) != EOF) {
|
while ((ch = getopt(argc, argv, "46Aa:dhHf:l:m:nP:p:R:rs:v?")) != EOF) {
|
||||||
switch ((char)ch) {
|
switch ((char)ch) {
|
||||||
case '4':
|
case '4':
|
||||||
family = PF_INET;
|
family = PF_INET;
|
||||||
@ -396,6 +396,10 @@ int main(int argc, char *argv[])
|
|||||||
Foreground = 1;
|
Foreground = 1;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'P':
|
||||||
|
PidFile = optarg;
|
||||||
|
break;
|
||||||
|
|
||||||
case 'p': /* path to regular log socket */
|
case 'p': /* path to regular log socket */
|
||||||
funixn[0] = optarg;
|
funixn[0] = optarg;
|
||||||
break;
|
break;
|
||||||
@ -681,13 +685,15 @@ int usage(int code)
|
|||||||
" -l HOST Host name to log without its FQDN, use ':' for multiple hosts\n"
|
" -l HOST Host name to log without its FQDN, use ':' for multiple hosts\n"
|
||||||
" -m INTV Interval between MARK messages in log, 0 to disable, default: 20\n"
|
" -m INTV Interval between MARK messages in log, 0 to disable, default: 20\n"
|
||||||
" -n Run in foreground, required when run from a modern init/supervisor\n"
|
" -n Run in foreground, required when run from a modern init/supervisor\n"
|
||||||
|
" -P FILE Specify an alternative file in which to store the process ID.\n"
|
||||||
|
" The default is %s."
|
||||||
" -p PATH Alternate path to UNIX domain socket, default: %s\n"
|
" -p PATH Alternate path to UNIX domain socket, default: %s\n"
|
||||||
" -r Act as remote syslog sink for other hosts\n"
|
" -r Act as remote syslog sink for other hosts\n"
|
||||||
" -s NAME Strip domain name before logging, use ':' for multiple domains\n"
|
" -s NAME Strip domain name before logging, use ':' for multiple domains\n"
|
||||||
" -v Show program version and exit\n"
|
" -v Show program version and exit\n"
|
||||||
"\n"
|
"\n"
|
||||||
"Bug report address: %s\n",
|
"Bug report address: %s\n",
|
||||||
_PATH_LOG, PACKAGE_BUGREPORT);
|
_PATH_LOGPID, _PATH_LOG, PACKAGE_BUGREPORT);
|
||||||
exit(code);
|
exit(code);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user