summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Jansa <Martin.Jansa@gmail.com>2011-11-19 15:55:56 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-11-30 15:38:30 +0000
commit9f5bc2177502a9872a4276407ed6a555e97fd6e6 (patch)
tree1c95f1fe5e591b4614b1de7bb544e3a33cdc430e
parent3a70e773de07bd06ab65c6ce2035d68476d99d65 (diff)
downloadpoky-9f5bc2177502a9872a4276407ed6a555e97fd6e6.tar.gz
cronie: use useradd.bbclass instead of hardcoded groupadd calls
(From OE-Core rev: 42dde10337d464948ede8f7e7eec543f2396793e) Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-extended/cronie/cronie_1.4.8.bb33
1 files changed, 15 insertions, 18 deletions
diff --git a/meta/recipes-extended/cronie/cronie_1.4.8.bb b/meta/recipes-extended/cronie/cronie_1.4.8.bb
index 064347e9d5..2d256277bc 100644
--- a/meta/recipes-extended/cronie/cronie_1.4.8.bb
+++ b/meta/recipes-extended/cronie/cronie_1.4.8.bb
@@ -18,7 +18,7 @@ DEPENDS += "${@base_contains('DISTRO_FEATURES', 'pam', 'libpam', '', d)}"
18RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)}" 18RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)}"
19PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" 19PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid"
20 20
21PR = "r1" 21PR = "r2"
22 22
23SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \ 23SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \
24 file://crond.init \ 24 file://crond.init \
@@ -31,7 +31,7 @@ PAM_SRC_URI = "file://crond_pam_config.patch"
31SRC_URI[md5sum] = "9b1d2ce6db8d1883e06635f437170657" 31SRC_URI[md5sum] = "9b1d2ce6db8d1883e06635f437170657"
32SRC_URI[sha256sum] = "a3b910876f255712f1a5c364b74f34b0ceac9f6f3bbc45e854c5722785f513b3" 32SRC_URI[sha256sum] = "a3b910876f255712f1a5c364b74f34b0ceac9f6f3bbc45e854c5722785f513b3"
33 33
34inherit autotools update-rc.d 34inherit autotools update-rc.d useradd
35 35
36EXTRA_OECONF += "\ 36EXTRA_OECONF += "\
37 ${@base_contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)}" 37 ${@base_contains('DISTRO_FEATURES', 'pam', '--with-pam', '--without-pam', d)}"
@@ -39,6 +39,9 @@ EXTRA_OECONF += "\
39INITSCRIPT_NAME = "crond" 39INITSCRIPT_NAME = "crond"
40INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ." 40INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ."
41 41
42USERADD_PACKAGES = "${PN}"
43GROUPADD_PARAM_${PN} = "crontab"
44
42do_install_append () { 45do_install_append () {
43 install -d ${D}${sysconfdir}/sysconfig/ 46 install -d ${D}${sysconfdir}/sysconfig/
44 install -d ${D}${sysconfdir}/init.d/ 47 install -d ${D}${sysconfdir}/init.d/
@@ -54,25 +57,19 @@ do_install_append () {
54 mkdir -p ${D}${sysconfdir}/cron.weekly 57 mkdir -p ${D}${sysconfdir}/cron.weekly
55 mkdir -p ${D}${sysconfdir}/cron.monthly 58 mkdir -p ${D}${sysconfdir}/cron.monthly
56 touch ${D}${sysconfdir}/cron.deny 59 touch ${D}${sysconfdir}/cron.deny
57} 60
58
59FILES_${PN} += "${sysconfdir}/cron*"
60
61pkg_postinst_${PN} () {
62 if [ "x$D" != "x" ] ; then
63 exit 1
64 fi
65
66 # below setting is necessary to allow normal user using crontab 61 # below setting is necessary to allow normal user using crontab
67 62
68 # add 'crontab' group and setgid for crontab binary 63 # setgid for crontab binary
69 grep crontab /etc/group || addgroup crontab 64 chown root:crontab ${D}/usr/bin/crontab
70 chown root:crontab /usr/bin/crontab 65 chmod 2755 ${D}/usr/bin/crontab
71 chmod 2755 /usr/bin/crontab
72 66
73 # allow 'crontab' group write to /var/spool/cron 67 # allow 'crontab' group write to /var/spool/cron
74 chown root:crontab /var/spool/cron 68 chown root:crontab ${D}/var/spool/cron
75 chmod 770 /var/spool/cron 69 chmod 770 ${D}/var/spool/cron
76 70
77 chmod 600 /etc/crontab 71 chmod 600 ${D}/etc/crontab
78} 72}
73
74FILES_${PN} += "${sysconfdir}/cron*"
75