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:55:15 +0100 |
commit | 4593e1b0a3bcc3027e801bca0354887884ff9e15 (patch) | |
tree | e5ec65b6e6001018852fd9b3f8c5b1aeaadba753 | |
parent | b882c0f995d97e59190e71730c7e67c5e5289a94 (diff) | |
download | poky-4593e1b0a3bcc3027e801bca0354887884ff9e15.tar.gz |
cronie: add systemd support
Add systemd support for cronie.
(From OE-Core rev: 8a92601f8a2030f7875ee1fc6f09fd8242bd7e0d)
Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-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 0000000000..d435a6eb34 --- /dev/null +++ b/meta/recipes-extended/cronie/cronie/crond.service | |||
@@ -0,0 +1,11 @@ | |||
1 | [Unit] | ||
2 | Description=Periodic Command Scheduler | ||
3 | |||
4 | [Service] | ||
5 | EnvironmentFile=/etc/sysconfig/crond | ||
6 | ExecStart=@SBINDIR@/crond -n $CRONDARGS | ||
7 | ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID | ||
8 | Restart=always | ||
9 | |||
10 | [Install] | ||
11 | 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 d98d0d9167..2a932e056c 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 \ | |||
19 | file://fix-out-of-tree-build.patch \ | 19 | file://fix-out-of-tree-build.patch \ |
20 | file://crond.init \ | 20 | file://crond.init \ |
21 | file://crontab \ | 21 | file://crontab \ |
22 | file://crond.service \ | ||
22 | ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" | 23 | ${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_SRC_URI}', '', d)}" |
23 | 24 | ||
24 | PAM_SRC_URI = "file://crond_pam_config.patch" | 25 | PAM_SRC_URI = "file://crond_pam_config.patch" |
@@ -27,7 +28,7 @@ PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" | |||
27 | SRC_URI[md5sum] = "2ba645cf54de17f138ef70312843862f" | 28 | SRC_URI[md5sum] = "2ba645cf54de17f138ef70312843862f" |
28 | SRC_URI[sha256sum] = "fd08084cedddbb42499f80ddb7f2158195c3555c2ff40ee11d4ece2f9864d7be" | 29 | SRC_URI[sha256sum] = "fd08084cedddbb42499f80ddb7f2158195c3555c2ff40ee11d4ece2f9864d7be" |
29 | 30 | ||
30 | inherit autotools update-rc.d useradd | 31 | inherit autotools update-rc.d useradd systemd |
31 | 32 | ||
32 | 33 | ||
33 | PACKAGECONFIG ?= "${@base_contains('DISTRO_FEATURES', 'pam', 'pam', '', d)}" | 34 | 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 ." | |||
42 | USERADD_PACKAGES = "${PN}" | 43 | USERADD_PACKAGES = "${PN}" |
43 | GROUPADD_PARAM_${PN} = "--system crontab" | 44 | GROUPADD_PARAM_${PN} = "--system crontab" |
44 | 45 | ||
46 | SYSTEMD_SERVICE_${PN} = "crond.service" | ||
47 | |||
45 | do_install_append () { | 48 | do_install_append () { |
46 | install -d ${D}${sysconfdir}/sysconfig/ | 49 | install -d ${D}${sysconfdir}/sysconfig/ |
47 | install -d ${D}${sysconfdir}/init.d/ | 50 | install -d ${D}${sysconfdir}/init.d/ |
48 | install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond | 51 | install -m 0644 ${S}/crond.sysconfig ${D}${sysconfdir}/sysconfig/crond |
49 | install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond | 52 | install -m 0755 ${WORKDIR}/crond.init ${D}${sysconfdir}/init.d/crond |
50 | 53 | ||
54 | # install systemd unit files | ||
55 | install -d ${D}${systemd_unitdir}/system | ||
56 | install -m 0644 ${WORKDIR}/crond.service ${D}${systemd_unitdir}/system | ||
57 | sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \ | ||
58 | -e 's,@SBINDIR@,${sbindir},g' \ | ||
59 | ${D}${systemd_unitdir}/system/crond.service | ||
60 | |||
51 | # below are necessary for a complete cron environment | 61 | # below are necessary for a complete cron environment |
52 | install -d ${D}${localstatedir}/spool/cron | 62 | install -d ${D}${localstatedir}/spool/cron |
53 | install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/ | 63 | install -m 0755 ${WORKDIR}/crontab ${D}${sysconfdir}/ |