Hi Alexander,

Alexander Bluhm wrote on Fri, Aug 31, 2018 at 08:59:15PM +0200:

> A coworker did not know that he has to send SIGHUP to syslogd after
> rotating the log files.  I realized that it is not documented.
> 
> ok to add it to the man page?
> 
> While there, replace two 'syslogd' with .Nm for consistency.

OK schwarze@ either way.

You might want to insert "also" after "After log file rotation it is"
because you are describung a second use case for SIGHUP shortly after
the first one was described, if you stay with your version.

I think the text would be more logical - systematically describing
what the program does rather than listing different use cases with
repetitive information - by rearraging the information as follows,
or in a similar way as you desire:


When starting up,
.Nm
reads its configuration file,
.Xr syslogd.conf 5 ,
and opens the configured logfiles and TCP and TLS connections.
The configured logfiles already have to exist
with the correct permissions.
When receiving a
.Dv SIGHUP
signal, it closes all open logfiles and TCP and TLS connections
and re-runs this initialization sequence.
Sending this signal is required both after editing the configuration
file and after log rotation.
.Pp
.Nm
creates the file
.Pa /var/run/syslog.pid
and stores its process ID there.
The PID can be used to kill or reconfigure
.Nm syslogd .


I'd strongly recommend removing the two sentences about the PID
file because, well, PID files are a bad idea in general.  The fact
that such a (basically useless) file is created is still mentioned
below FILES.  At least, the recommendation to use the file for
sending signals to syslogd should be removed because that is clearly
bad advice.  In any case, if any of the information about the PID
file is left in place, it should be moved out of the paragraph into
its own paragraph because this not re-done on SIGHUP.

Yours,
  Ingo


> Index: usr.sbin/syslogd/syslogd.8
> ===================================================================
> RCS file: /data/mirror/openbsd/cvs/src/usr.sbin/syslogd/syslogd.8,v
> retrieving revision 1.58
> diff -u -p -r1.58 syslogd.8
> --- usr.sbin/syslogd/syslogd.8        8 Apr 2018 18:57:39 -0000       1.58
> +++ usr.sbin/syslogd/syslogd.8        31 Aug 2018 18:48:47 -0000
> @@ -159,15 +159,18 @@ syntax.
>  Create a UDP socket for receiving messages and bind it to the
>  specified address.
>  This can be used, for example, with a pf divert-to rule to receive
> -packets when syslogd is bound to localhost.
> +packets when
> +.Nm
> +is bound to localhost.
>  A port number may be specified using the
>  .Ar host : Ns Ar port
>  syntax.
>  .It Fl u
>  Select the historical
>  .Dq insecure
> -mode, in which syslogd will
> -accept input from the UDP port.
> +mode, in which
> +.Nm
> +will accept input from the UDP port.
>  Some software wants this, but you can be subjected to a variety of
>  attacks over the network, including attackers remotely filling logs.
>  .It Fl V
> @@ -197,6 +200,13 @@ It creates the file
>  and stores its process ID there.
>  The PID can be used to kill or reconfigure
>  .Nm .
> +After log file rotation it is necessary to send a
> +.Dv SIGHUP .
> +Then
> +.Nm
> +closes each old log file and starts writing into the new file, which
> +must have been created by the rotator with correct permissions.
> +Also outgoing TCP or TLS connections are closed and reopened.
>  .Pp
>  .Nm
>  opens a UDP socket, as specified

Reply via email to