F21 System Wide Change: cron to systemd time units

Lennart Poettering mzerqung at 0pointer.de
Tue Mar 4 19:07:18 UTC 2014


On Tue, 04.03.14 11:27, Pete Travis (lists at petetravis.com) wrote:

> > I'd also like to make sure we sell this properly. While I think it
> > should be a goal to port all cronjobs we *ship* over to this, I want to
> > make sure that cron is advertised as a good solution for people who just
> > want to queue a simple cronjob. This is because setting up a timer
> > service is more complex than setting up a cronjob. A cronjob is a single
> > line added to "crontab -e" or /etc/crontab. However, a systemd timer
> > unit will always be two files, and they will have 2+ lines each. While
> > the systemd way is certainly more uniform with the rest of service
> > management, it is definitely a bit more work, and I don't want to be in
> > competition here...
> 
> Will there be a way for regular users to use timer units? User= will
> execute as a regular user, sure, but root still needs to set that up.

Kinda no and kinda yes.

PID 1 will not do user jobs. However, systemd user instances will do
that for you. However, they don't run unless you are logged in or have
enabled lingering (with "loginctl set-linger"). The idea is that this is
strictly opt-in, and unless enabled via set-linger the user cannot take
up resources while not logged in. And if the the user is logged in (or
set-linger is used), then it will not enable time-based actviation for
it, but also other kinds of activation like .socket, and so on...)

So, we are different here, it's a lot more restricted, and you will have
a per-user systemd instance around if you make use of this, but then
again you get the real deal, not just timer based activation...

Lennart

-- 
Lennart Poettering, Red Hat


More information about the devel mailing list