[systemd-devel] timed events
Kay Sievers
kay at vrfy.org
Sat Jun 30 08:12:26 PDT 2012
On Fri, Jun 29, 2012 at 4:31 AM, Kok, Auke-jan H
<auke-jan.h.kok at intel.com> wrote:
> On Fri, Jun 29, 2012 at 12:49 AM, Nathan <qwerty.nat at gmail.com> wrote:
>> Looking at the systemd.timer documentation it seems as though all
>> the timers are relative. Is there any way to get absolute timers
>> relative to real time (cron like functionality - even in a later version?).
>
> not currently, the timer could should be expanded but it's not that
> simple to write something like that consistently.
We do not have calendar time event at the moment, because at the time
we did all that, we missed the needed kernel pieces. Note, that cron
needs to wake up every minute and checks if someone has changed the
wall clock, and we did not want to do that.
The proper kernel interfaces are there now for timerfd, and a
cron-like functionality can be implemented in systemd:
http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=99ee5315dac6211e972fa3f23bcc9a0343ff58c4
One piece that needs to be sorted out on the systemd side is the
notation how to specify the format for specific calendar events, and
for re-occuring events, and how and where to store when the last
execution happened, to allow cron + anachron + at functionality in one
and the same consistent interface. It *may* be some subset or
something inspired from rfc2445, but I don't think anybody has really
looked into it so far.
The current (not really thought out) idea is for systemd to support
all the simple cron.daily, cron.weekly, ... things and support that
with built-in timers, but leave *all* custom cron jobs and user-cron
to the original cron implementation.
Which means, that most of the usual systems will not need to install
cron/at, but have all the periodic cleanup tasks still hooked up and
functional by default.
If cron is installed, the service file would check for the existence
of a custom cron config file and would start cron only if it needs to
run.
I short: if you need cron run cron, but if you need only the usual
periodic tasks, or just calendar events and don't care about cron
configuration files, systemd should do it.
Kay
More information about the systemd-devel
mailing list