diff options
| author | Martin Jansa <Martin.Jansa@gmail.com> | 2011-11-19 15:55:56 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2011-11-30 15:38:30 +0000 |
| commit | 9f5bc2177502a9872a4276407ed6a555e97fd6e6 (patch) | |
| tree | 1c95f1fe5e591b4614b1de7bb544e3a33cdc430e | |
| parent | 3a70e773de07bd06ab65c6ce2035d68476d99d65 (diff) | |
| download | poky-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.bb | 33 |
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)}" | |||
| 18 | RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)}" | 18 | RDEPENDS_${PN} = "${@base_contains('DISTRO_FEATURES', 'pam', '${PAM_DEPS}', '', d)}" |
| 19 | PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" | 19 | PAM_DEPS = "libpam libpam-runtime pam-plugin-access pam-plugin-loginuid" |
| 20 | 20 | ||
| 21 | PR = "r1" | 21 | PR = "r2" |
| 22 | 22 | ||
| 23 | SRC_URI = "https://fedorahosted.org/releases/c/r/cronie/cronie-${PV}.tar.gz \ | 23 | SRC_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" | |||
| 31 | SRC_URI[md5sum] = "9b1d2ce6db8d1883e06635f437170657" | 31 | SRC_URI[md5sum] = "9b1d2ce6db8d1883e06635f437170657" |
| 32 | SRC_URI[sha256sum] = "a3b910876f255712f1a5c364b74f34b0ceac9f6f3bbc45e854c5722785f513b3" | 32 | SRC_URI[sha256sum] = "a3b910876f255712f1a5c364b74f34b0ceac9f6f3bbc45e854c5722785f513b3" |
| 33 | 33 | ||
| 34 | inherit autotools update-rc.d | 34 | inherit autotools update-rc.d useradd |
| 35 | 35 | ||
| 36 | EXTRA_OECONF += "\ | 36 | EXTRA_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 += "\ | |||
| 39 | INITSCRIPT_NAME = "crond" | 39 | INITSCRIPT_NAME = "crond" |
| 40 | INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ." | 40 | INITSCRIPT_PARAMS = "start 90 2 3 4 5 . stop 60 0 1 6 ." |
| 41 | 41 | ||
| 42 | USERADD_PACKAGES = "${PN}" | ||
| 43 | GROUPADD_PARAM_${PN} = "crontab" | ||
| 44 | |||
| 42 | do_install_append () { | 45 | do_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 | |||
| 59 | FILES_${PN} += "${sysconfdir}/cron*" | ||
| 60 | |||
| 61 | pkg_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 | |||
| 74 | FILES_${PN} += "${sysconfdir}/cron*" | ||
| 75 | |||
