On Sun, 2017-02-26 at 22:16 +0300, Andrei Borzenkov wrote:
26.02.2017 22:13, Rüdiger Meier пишет:
BTW I still have not understood if user timers would run for sure if I'm not logged in.
Not by default. systemd spawns one instance per user when first user session is opened. Once all sessions are terminated, user instance is shut down (stopping all units) unless lingering is enabled for this user. Enabling lingering is privileged operation.
When lingering is enabled for a user, user instance is started when system boots and persists until system is shutdown.
That's still very different from cron. With cron, a user can have jobs
running without ever having logged in, and independent of "lingering".
That's very useful, I've done it on practically all systems I've been
doing serious work on. It's also highly useful for non-human system
accounts that need to do stuff repeatedly.
(Btw, "lingering" enables quite some additional services to run on the
user's behalf except timers, doesn't it? I'm not sure if I'd want that
but I have to admit I haven't looked at the details so far).
I'm certain there's some kind of systemd magic that would also make
this kind of scheduling-without-login possible. But it's nowhere close
to being able to replace cron. Maybe in the long run, systemd's
capabilities in this area will actually surpass cron's, and maybe even
usability will be a match. But that day hasn't come yet.
Regards
Martin
--
Dr. Martin Wilck