Comment 13 for bug 1331891

Revision history for this message
Dimitri John Ledkov (xnox) wrote : Re: [Bug 1331891] Re: [systemd] /etc/logrotate.d/rsyslog fails to reload rsyslog

On 8 July 2014 13:25, Michael Biebl <email address hidden> wrote:
> 2014-07-08 14:01 GMT+02:00 Dimitri John Ledkov <email address hidden>:
>> systemd unit for which "reload" similarly sends SIGHUP. In debian
>> unstable a native systemd unit is added for rsyslog, for which reload
>> similarly just sends SIGHUP.
>
> That is not true. The rsyslog.service file in Debian's rsyslog package
> does *not* have ExecReload set, at least not anymore.
> The ExecReload setting was removed upstream because a "reload" means
> that a daemon rereads its configuration, which it no longer does for
> rsyslog.
>

I see.

> Which means, you can't run "systemctl reload rsyslog.service".
>
> # systemctl reload rsyslog.service
> Failed to reload rsyslog.service: Job type reload is not applicable
> for unit rsyslog.service.
>
> The logrotate file for rsyslog in Debian currently uses
> invoke-rc.d rsyslog rotate
>
> This is an action only implemented by the SysV init script. That means
> it currently actually relies on the SysV init script even when booted
> with systemd.
>
> In Debian, SysV init scripts are still mandatory, so this is sort-of
> ok, even though I don't particularly like this situation.
>
> A solution that would work with all init systems would be something like
>
> kill -SIGHUP $(cat /var/run/rsyslogd.pid).
>
> A systemd-only solution would look like this:
>
> systemctl kill -s HUP rsyslog.service
>
>
<merging>
> Maybe shipping a small helper script named rsyslog-rotate in
> /usr/sbin might be the best solution for this.

postrotate should send HUP to rsyslog in a init neutral way.
reload is not a required command, and defined to do more than mere HUP
signal implementation in current rsyslogd.
I'm for "kill -SIGHUP $(cat /var/run/rsyslogd.pid)" or a helper
binary, without supporting "reload" command in neither systemd unit,
nor in initd script.
(since reload not supported upstream and rsyslogd instructs sysadmins
to restart daemon to reload configuration)
I'm undecided about, a helper binary vs "kill" line. Kill line is
documented in the manpage, thus is expected interface.

--
Regards,

Dimitri.