diff options
author | Wenzong Fan <wenzong.fan@windriver.com> | 2016-06-21 02:01:31 -0400 |
---|---|---|
committer | Martin Jansa <Martin.Jansa@gmail.com> | 2016-06-23 15:21:26 +0200 |
commit | c29c8e3a8f8746b2061e3c532f13ae99c55fb42a (patch) | |
tree | b1f39c0c52f563bdbae6dc70fd1a76acf6363a15 /meta-oe/recipes-connectivity | |
parent | 016e7480a885b90a3ed2d336b54676d0237b3439 (diff) | |
download | meta-openembedded-c29c8e3a8f8746b2061e3c532f13ae99c55fb42a.tar.gz |
krb5: add systemd support
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-oe/recipes-connectivity')
3 files changed, 47 insertions, 9 deletions
diff --git a/meta-oe/recipes-connectivity/krb5/krb5/krb5-admin-server.service b/meta-oe/recipes-connectivity/krb5/krb5/krb5-admin-server.service new file mode 100644 index 000000000..1b4271643 --- /dev/null +++ b/meta-oe/recipes-connectivity/krb5/krb5/krb5-admin-server.service | |||
@@ -0,0 +1,14 @@ | |||
1 | [Unit] | ||
2 | Description=MIT Kerberos KDC administrative daemon | ||
3 | After=syslog.target network.target | ||
4 | ConditionPathExists=/etc/krb5.conf | ||
5 | |||
6 | [Service] | ||
7 | Type=forking | ||
8 | ExecStartPre=/bin/sh -c "test ! -f /var/log/kadmind.log || test ! -x /sbin/restorecon || /sbin/restorecon -F /var/log/kadmind.log" | ||
9 | ExecStart=/usr/sbin/kadmind | ||
10 | SuccessExitStatus=1 2 SIGKILL | ||
11 | TimeoutStopSec=30 | ||
12 | |||
13 | [Install] | ||
14 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-connectivity/krb5/krb5/krb5-kdc.service b/meta-oe/recipes-connectivity/krb5/krb5/krb5-kdc.service new file mode 100644 index 000000000..d5e5a9579 --- /dev/null +++ b/meta-oe/recipes-connectivity/krb5/krb5/krb5-kdc.service | |||
@@ -0,0 +1,13 @@ | |||
1 | [Unit] | ||
2 | Description=MIT Kerberos KDC | ||
3 | After=syslog.target network.target | ||
4 | ConditionPathExists=/etc/krb5.conf | ||
5 | |||
6 | [Service] | ||
7 | Type=forking | ||
8 | ExecStart=/usr/sbin/krb5kdc | ||
9 | SuccessExitStatus=1 2 SIGKILL | ||
10 | TimeoutStopSec=30 | ||
11 | |||
12 | [Install] | ||
13 | WantedBy=multi-user.target | ||
diff --git a/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb b/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb index 0c566cbc2..500e194d5 100644 --- a/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb +++ b/meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb | |||
@@ -17,7 +17,7 @@ LICENSE = "MIT" | |||
17 | LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=f64248328d2d9928e1f04158b5243e7f" | 17 | LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=f64248328d2d9928e1f04158b5243e7f" |
18 | DEPENDS = "ncurses util-linux e2fsprogs e2fsprogs-native" | 18 | DEPENDS = "ncurses util-linux e2fsprogs e2fsprogs-native" |
19 | 19 | ||
20 | inherit autotools-brokensep binconfig perlnative | 20 | inherit autotools-brokensep binconfig perlnative systemd |
21 | 21 | ||
22 | SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" | 22 | SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}" |
23 | SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}-signed.tar \ | 23 | SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}-signed.tar \ |
@@ -32,6 +32,8 @@ SRC_URI = "http://web.mit.edu/kerberos/dist/${BPN}/${SHRT_VER}/${BP}-signed.tar | |||
32 | file://etc/init.d/krb5-admin-server \ | 32 | file://etc/init.d/krb5-admin-server \ |
33 | file://etc/default/krb5-kdc \ | 33 | file://etc/default/krb5-kdc \ |
34 | file://etc/default/krb5-admin-server \ | 34 | file://etc/default/krb5-admin-server \ |
35 | file://krb5-kdc.service \ | ||
36 | file://krb5-admin-server.service \ | ||
35 | file://krb5-CVE-2016-3119.patch;striplevel=2 \ | 37 | file://krb5-CVE-2016-3119.patch;striplevel=2 \ |
36 | file://0001-Work-around-uninitialized-warning-in-cc_kcm.c.patch;striplevel=2 \ | 38 | file://0001-Work-around-uninitialized-warning-in-cc_kcm.c.patch;striplevel=2 \ |
37 | " | 39 | " |
@@ -40,6 +42,9 @@ SRC_URI[sha256sum] = "e528c30b0209c741f6f320cb83122ded92f291802b6a1a1dc1a01dcdb3 | |||
40 | 42 | ||
41 | S = "${WORKDIR}/${BP}/src" | 43 | S = "${WORKDIR}/${BP}/src" |
42 | 44 | ||
45 | SYSTEMD_SERVICE_${PN} = "krb5-admin-server.service krb5-kdc.service" | ||
46 | SYSTEMD_AUTO_ENABLE = "disable" | ||
47 | |||
43 | PACKAGECONFIG ??= "openssl" | 48 | PACKAGECONFIG ??= "openssl" |
44 | PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" | 49 | PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit" |
45 | PACKAGECONFIG[openssl] = "--with-pkinit-crypto-impl=openssl,,openssl" | 50 | PACKAGECONFIG[openssl] = "--with-pkinit-crypto-impl=openssl,,openssl" |
@@ -79,20 +84,26 @@ do_configure() { | |||
79 | } | 84 | } |
80 | 85 | ||
81 | do_install_append() { | 86 | do_install_append() { |
82 | mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default | ||
83 | install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d | ||
84 | install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default | ||
85 | |||
86 | rm -rf ${D}/${localstatedir}/run | 87 | rm -rf ${D}/${localstatedir}/run |
87 | mkdir -p ${D}/${sysconfdir}/default/volatiles | 88 | |
88 | echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \ | 89 | if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then |
89 | > ${D}${sysconfdir}/default/volatiles/87_krb5 | 90 | mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default |
91 | install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d | ||
92 | install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default | ||
93 | |||
94 | mkdir -p ${D}/${sysconfdir}/default/volatiles | ||
95 | echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \ | ||
96 | > ${D}${sysconfdir}/default/volatiles/87_krb5 | ||
97 | fi | ||
90 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then | 98 | if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then |
91 | install -d ${D}${sysconfdir}/tmpfiles.d | 99 | install -d ${D}${sysconfdir}/tmpfiles.d |
92 | echo "d /run/krb5kdc - - - -" \ | 100 | echo "d /run/krb5kdc - - - -" \ |
93 | > ${D}${sysconfdir}/tmpfiles.d/krb5.conf | 101 | > ${D}${sysconfdir}/tmpfiles.d/krb5.conf |
94 | fi | ||
95 | 102 | ||
103 | install -d ${D}${systemd_system_unitdir} | ||
104 | install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir} | ||
105 | install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir} | ||
106 | fi | ||
96 | } | 107 | } |
97 | 108 | ||
98 | pkg_postinst_${PN} () { | 109 | pkg_postinst_${PN} () { |