Re: [PATCH] maintenance: use systemd timers on Linux
- From
brian m. carlson <sandals@crustytoothpaste.net>
- Date
- May 1, 2021, 20:02 UTC
- Message-ID
- <YI2zzKMJ1eDH3U/S@camp.crustytoothpaste.net>
- In-Reply-To
- <20210501145220.2082670-1-lenaic@lhuard.fr>
On 2021-05-01 at 14:52:20, Lénaïc Huard wrote:
Show 19 quoted lines
> The existing mechanism for scheduling background maintenance is done > through cron. On Linux systems managed by systemd, systemd provides an > alternative to schedule recurring tasks: systemd timers. > > The main motivations to implement systemd timers in addition to cron > are: > * cron is optional and Linux systems running systemd might not have it > installed. > * The execution of `crontab -l` can tell us if cron is installed but not > if the daemon is actually running. > * With systemd, each service is run in its own cgroup and its logs are > tagged by the service inside journald. With cron, all scheduled tasks > are running in the cron daemon cgroup and all the logs of the > user-scheduled tasks are pretended to belong to the system cron > service. > Concretely, a user that doesn’t have access to the system logs won’t > have access to the log of its own tasks scheduled by cron whereas he > will have access to the log of its own tasks scheduled by systemd > timer.
I would prefer to see this as a configurable option. I have systemd installed (because it's not really optional to have a functional desktop on Linux) but I want to restrict it to starting and stopping services, not performing the tasks of cron. cron is portable across a wide variety of systems, including Linux variants (and WSL) that don't use systemd, and I prefer to use more standard tooling when possible.
-- brian m. carlson (he/him or they/them) Houston, Texas, US