[systemd-devel] Antw: Re: Q: Implementing logrotate's postrotate with systemd

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Tue Jun 11 12:23:34 UTC 2019


>>> Michael Biebl <mbiebl at gmail.com> schrieb am 11.06.2019 um 14:13 in Nachricht
<CAGWsdOie2tWTibwFafu4Pd0ib1myg9uNiOPGvZ-y1HkFow-E0Q at mail.gmail.com>:
> A separate oneshot service sounds like overkill. I would probably use
> something like
> `systemctl kill -s HUP ${service}.service`
> If your sevices spawns multiple processes and you only want to send
> SIGHUP to the main process, you should add a `--kill-who=main`

Thanks! I wasn't aware of systemctl's "kill".

Regards,
Ulrich

> 
> All documented nicely in
> https://www.freedesktop.org/software/systemd/man/systemctl.html 
> 
> Am Di., 11. Juni 2019 um 13:34 Uhr schrieb Ulrich Windl
> <Ulrich.Windl at rz.uni-regensburg.de>:
>>
>> Hi!
>>
>> 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?
>>
>> Regards,
>> Ulrich
>>
>>
>>
>> _______________________________________________
>> systemd-devel mailing list
>> systemd-devel at lists.freedesktop.org 
>> https://lists.freedesktop.org/mailman/listinfo/systemd-devel 
> 
> 
> 
> -- 
> Why is it that all of the instruments seeking intelligent life in the
> universe are pointed away from Earth?
> _______________________________________________
> 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