diff options
author | Chen Qi <Qi.Chen@windriver.com> | 2014-04-23 17:40:50 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-04-24 17:54:57 +0100 |
commit | 8a92601f8a2030f7875ee1fc6f09fd8242bd7e0d (patch) | |
tree | 27ea252737b4f61616d19c7a1ced5bd1698349c0 /meta/recipes-extended/cronie | |
parent | c2eb5cd1aa4632f7ee8c261414e599dcb6f40a8b (diff) | |
download | openembedded-core-contrib-8a92601f8a2030f7875ee1fc6f09fd8242bd7e0d.tar.gz |
cronie: add systemd support
Add systemd support for cronie.
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended/cronie')
-rw-r--r-- | meta/recipes-extended/cronie/cronie/crond.service | 11 | ||||
-rw-r--r-- | meta/recipes-extended/cronie/cronie_1.4.11.bb | 12 |
2 files changed, 22 insertions, 1 deletions
diff --git a/meta/recipes-extended/cronie/cronie/crond.service b/meta/recipes-extended/cronie/cronie/crond.service new file mode 100644 index 00000000000..d435a6eb340 --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/crond.service @@ -0,0 +1,11 @@ +[Unit] +Description=Periodic Command Scheduler + +[Service] +EnvironmentFile=/etc/sysconfig/crond +ExecStart=@SBINDIR@/crond -n $CRONDARGS +ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID +Restart=always + +[Install] +WantedBy=multi-user.target diff --git a/meta/recipes-extended/cronie/cronie_1.4.11.bb b/meta/recipes-extended/cronie/cronie_1.4.11.bb index d98d0d9167a..2a932e056c8 100644 --- a/meta/recipes-extended/cronie/cronie_1.4.11.bb +++ b/meta/recipes-extended/cronie/cronie_1.4.11.bb @@ -19,6 +19,7 @@ SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \ file://fix-out-of-tree-build.patch \ file://crond.init \ file://crontab \ + file://crond.service \ ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" PAM_SRC_URI = "file://crond_pam_config.patch" @@ -27,7 +28,7 @@ PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" SRC_URI[md5sum] = "2ba645cf54de17f138ef70312843862f" SRC_URI[sha256sum] = "fd08084cedddbb42499f80ddb7f2158195c3555c2ff40ee11d4ece2f9864d7be" -inherit autotools update-rc.d useradd +inherit autotools update-rc.d useradd systemd PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" @@ -42,12 +43,21 @@ INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ." USERADD_PACKAGES = "${PN}" GROUPADD_PARAM_${PN} = "--system crontab" +SYSTEMD_SERVICE_${PN} = "crond.service" + do_install_append () { install -d ${D}${sysconfdir}/sysconfig/ install -d ${D}${sysconfdir}/init.d/ install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond + # install systemd unit files + install -d ${D}${systemd_unitdir}/system + install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system + sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ + -e 's,@SBINDIR@,${sbindir},g' \ + ${D}${systemd_unitdir}/system/crond.service + # below are necessary for a complete cron environment install -d ${D}${localstatedir}/spool/cron install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/ |