On Wed, 2 Jan 2013 11:07:01 +0200 (EET) Dimitrios Apostolou email@example.com wrote:
among various tasks, I also run "sysstat" for monitoring my server's load. The way it runs by default is via the hourly cron, as a job that lasts exactly one hour. Sometimes I need to stop crond (systemctl stop dcron) to perform some short maintainance, and restart it a minute later that I'm done.
Previously the "sadc" monitoring process of sysstat wasn't being killed, since it double forked and stayed up as a daemon. Unfortunately now systemd kills the whole cgroup, and in this manner it's possible to lose up to one hour of accounting logs. Any ideas on how to instruct systemd to not kill it when terminating crond?
Thanks in advance, Dimitris
As a sidenote: You could use a systemd timer unit instead of cron. You can start/stop them on a per unit basis instead of having to kill off the whole of cron.