Skip to content

Commit

Permalink
Add the ability to specify alternate PID file for syslogd.
Browse files Browse the repository at this point in the history
PR:		25784
Submitted by:	Jon Villarreal <jonv@ivmg.net>
Reviewed by:	iedowse
  • Loading branch information
dwmalone committed May 10, 2001
1 parent 44ced8b commit f0ee959
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
11 changes: 8 additions & 3 deletions usr.sbin/syslogd/syslogd.8
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
.Op Fl f Ar config_file
.Op Fl m Ar mark_interval
.Op Fl p Ar log_socket
.Op Fl P Ar pid_file
.Op Fl l Ar path
.Sh DESCRIPTION
The
Expand Down Expand Up @@ -172,6 +173,10 @@ Disable dns query for every request.
Specify the pathname of an alternate log socket to be used instead;
the default is
.Pa /var/run/log .
.It Fl P
Specify an alternative file in which to store the process id.
The default is
.Pa /var/run/syslog.pid .
.It Fl l
Specify a location where
.Nm
Expand Down Expand Up @@ -220,7 +225,8 @@ and from the special device
.Pp
The
.Nm
daemon creates the file
daemon creates its process id file,
by default
.Pa /var/run/syslog.pid ,
and stores its process
id there.
Expand All @@ -241,8 +247,7 @@ include file
.It Pa /etc/syslog.conf
configuration file
.It Pa /var/run/syslog.pid
process id of current
.Nm
default process id file
.It Pa /var/run/log
name of the
.Tn UNIX
Expand Down
9 changes: 6 additions & 3 deletions usr.sbin/syslogd/syslogd.c
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ main(argc, argv)
pid_t ppid = 1;
socklen_t len;

while ((ch = getopt(argc, argv, "46Aa:df:kl:m:np:suv")) != -1)
while ((ch = getopt(argc, argv, "46Aa:df:kl:m:np:P:suv")) != -1)
switch (ch) {
case '4':
family = PF_INET;
Expand Down Expand Up @@ -367,6 +367,9 @@ main(argc, argv)
case 'p': /* path */
funixn[0] = optarg;
break;
case 'P': /* path for alt. PID */
PidFile = optarg;
break;
case 's': /* no network mode */
SecureMode++;
break;
Expand Down Expand Up @@ -596,8 +599,8 @@ usage()

fprintf(stderr, "%s\n%s\n%s\n",
"usage: syslogd [-46Adnsuv] [-a allowed_peer] [-f config_file]",
" [-m mark_interval] [-p log_socket]",
" [-l log_socket]");
" [-m mark_interval] [-l log_socket]",
" [-p log_socket] [-P pid_file]");
exit(1);
}

Expand Down

0 comments on commit f0ee959

Please sign in to comment.