[systemd-devel] Antw: Re: Q: Implementing logrotate's postrotate with systemd
Ulrich Windl
Ulrich.Windl at rz.uni-regensburg.de
Tue Jun 11 13:00:06 UTC 2019
>>> Reindl Harald <h.reindl at thelounge.net> schrieb am 11.06.2019 um 14:30 in
Nachricht <917331d8-845f-54d5-908c-e6c7d124a3c6 at thelounge.net>:
>
> Am 11.06.19 um 13:34 schrieb Ulrich Windl:
>> I have a forking service (with a PID file) that can reopen the logfile after
> receiving SIGHUP. In the past I had implemented "rc{service} rotate" to send
> SIGHUP to the daemon as "postrotate" action. After converting (actually being
> converted ;-)) to systemd I dropped the LSB script, and wonder which command
> to use as "postrotate" action:
>>
>> Should I implement a oneshot service (using "systemctl start {service}")
> that does depend on the actual service and send a SIGHUP on start, or is
> there a more elegent solution?
>
> that's what reload is all about
>
> [harry at srv-rhsoft:/etc/systemd/system]$ cat named.service | grep Reload
> ExecReload=/usr/bin/kill -HUP $MAINPID
The manual page says it's about "configuration reload". I was talking about logfile rotation (my service does not suport configuration reload (other than restart)).
>
> [harry at srv-rhsoft:/etc/systemd/system]$ cat rsyslog.service | grep Reload
> ExecReload=/usr/bin/kill -HUP $MAINPID
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/systemd-devel
More information about the systemd-devel
mailing list