[packages/systemd-cronjobs] README improved, Release: 1
jajcus
jajcus at pld-linux.org
Fri Mar 10 13:14:27 CET 2017
commit 578a39a1e18d02fd202fa8a918df33fe5e65f948
Author: Jacek Konieczny <j.konieczny at eggsoft.pl>
Date: Fri Mar 10 13:14:06 2017 +0100
README improved, Release: 1
README | 65 ++++++++++++++++++++++++++++++++++++++++++++++-----
systemd-cronjobs.spec | 2 +-
2 files changed, 60 insertions(+), 7 deletions(-)
---
diff --git a/systemd-cronjobs.spec b/systemd-cronjobs.spec
index 5c05d46..325392e 100644
--- a/systemd-cronjobs.spec
+++ b/systemd-cronjobs.spec
@@ -2,7 +2,7 @@ Summary: crond-like services for systemd
Summary(pl.UTF-8): Usługi typu crond dla systemd
Name: systemd-cronjobs
Version: 0.1
-Release: 0.1
+Release: 1
License: GPL v2
Group: Base
Source0: cronjobs.target
diff --git a/README b/README
index ed3814b..70376ab 100644
--- a/README
+++ b/README
@@ -25,13 +25,52 @@ nor by users.
Packaging cronjobs
------------------
-A package, to be compatible both with crond and systemd-cronjobs, should
-'Require: cronjobs' (instead of 'crondaemon' or 'crontabs') and provide both
-a crontab and a set of two systemd units:
+/etc/cron.{hourly,daily,monthly,weekly} only
+............................................
+
+Just make sure they don't require 'crondaemon' or 'crontabs', a directory
+dependece should pull a crond or systemd-cronjobs.
+
+Explicit 'Require: cronjobs' can be added, but is not required
+
+/etc/cron.d/* crontabs, no existing systemd timers
+..................................................
+
+Until systemd-cronjobs compatible timer units are added, the old 'crondaemon'
+or 'crontabs' dependency should be used.
+
+To make package compatible with systemd-cronjobs systemd timer and service
+units should be added for every crontab entry:
cronjob-%{name}.timer
cronjob-%{name}.service
+
+For a crontab like this:
+01 23 * * * someuser do_something
+
+The equivalent systemd units would be:
+
+cronjob-something.timer:
+
+[Unit]
+Description=something cronjob timer
+
+[Timer]
+OnCalendar=23:01
+
+[Install]
+WantedBy=cronjobs.target
+
+cronjobs-something.service:
+
+[Unit]
+Description=something cronjob
+
+[Service]
+ExecStart=/usr/bin/do_something
+User=someuser
+
The first one defines the schedule and should be WantedBy cronjobs.target (not
multi-user.target, so it is used only when crond is not installed). The other
defines how the service should be started each time the timer fires.
@@ -39,9 +78,23 @@ defines how the service should be started each time the timer fires.
The usual %systemd_{post,preun,reload} macros should be used in
%post/%preun/%postun for the cronjob-%{name}.timer unit.
-For packages that do not have own crontabs, but just drop a script into
-/etc/cron.{hourly,daily,weekly,monthly} directory the only required change is
-the 'Require: cronjobs' dependency.
+After systemd timers are added the 'crondaemon'/'crontabs' dependency should
+be changed to: Requires: cronjobs. This will allow using crond or systemd
+timers.
+
+systemd-only packages
+.....................
+
+Packages that are designed only for systemd do not need this systemd-cronjobs
+package. They may provide just own systemd timers, installed under
+multi-user.target or timers.target.
+
+packages with upstream provided crontabs and systemd timers
+...........................................................
+
+If upstream provides crontab and systemd.timer that don't conflict with each
+other, then they can be used and the crondaemon/crontabs/cronjobs dependecny
+may be dropped (unless it is critical for the timed services to be started).
Packaging cron daemons
----------------------
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/systemd-cronjobs.git/commitdiff/578a39a1e18d02fd202fa8a918df33fe5e65f948
More information about the pld-cvs-commit
mailing list