aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWenzong Fan <wenzong.fan@windriver.com>2016-06-21 02:01:31 -0400
committerMartin Jansa <Martin.Jansa@gmail.com>2016-06-23 15:21:26 +0200
commitc29c8e3a8f8746b2061e3c532f13ae99c55fb42a (patch)
treeb1f39c0c52f563bdbae6dc70fd1a76acf6363a15
parent016e7480a885b90a3ed2d336b54676d0237b3439 (diff)
downloadmeta-openembedded-contrib-c29c8e3a8f8746b2061e3c532f13ae99c55fb42a.tar.gz
meta-openembedded-contrib-c29c8e3a8f8746b2061e3c532f13ae99c55fb42a.tar.bz2
meta-openembedded-contrib-c29c8e3a8f8746b2061e3c532f13ae99c55fb42a.zip
krb5: add systemd support
Signed-off-by: Wenzong Fan <wenzong.fan@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
-rw-r--r--meta-oe/recipes-connectivity/krb5/krb5/krb5-admin-server.service14
-rw-r--r--meta-oe/recipes-connectivity/krb5/krb5/krb5-kdc.service13
-rw-r--r--meta-oe/recipes-connectivity/krb5/krb5_1.13.2.bb29
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 0000000000..1b4271643e
--- /dev/null
+++ b/meta-oe/recipes-connectivity/krb5/krb5/krb5-admin-server.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=MIT Kerberos KDC administrative daemon
+After=syslog.target network.target
+ConditionPathExists=/etc/krb5.conf
+
+[Service]
+Type=forking
+ExecStartPre=/bin/sh -c "test ! -f /var/log/kadmind.log || test ! -x /sbin/restorecon || /sbin/restorecon -F /var/log/kadmind.log"
+ExecStart=/usr/sbin/kadmind
+SuccessExitStatus=1 2 SIGKILL
+TimeoutStopSec=30
+
+[Install]
+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 0000000000..d5e5a95794
--- /dev/null
+++ b/meta-oe/recipes-connectivity/krb5/krb5/krb5-kdc.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=MIT Kerberos KDC
+After=syslog.target network.target
+ConditionPathExists=/etc/krb5.conf
+
+[Service]
+Type=forking
+ExecStart=/usr/sbin/krb5kdc
+SuccessExitStatus=1 2 SIGKILL
+TimeoutStopSec=30
+
+[Install]
+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 0c566cbc24..500e194d5e 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"
LIC_FILES_CHKSUM = "file://${S}/../NOTICE;md5=f64248328d2d9928e1f04158b5243e7f"
DEPENDS = "ncurses util-linux e2fsprogs e2fsprogs-native"
-inherit autotools-brokensep binconfig perlnative
+inherit autotools-brokensep binconfig perlnative systemd
SHRT_VER = "${@oe.utils.trim_version("${PV}", 2)}"
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
file://etc/init.d/krb5-admin-server \
file://etc/default/krb5-kdc \
file://etc/default/krb5-admin-server \
+ file://krb5-kdc.service \
+ file://krb5-admin-server.service \
file://krb5-CVE-2016-3119.patch;striplevel=2 \
file://0001-Work-around-uninitialized-warning-in-cc_kcm.c.patch;striplevel=2 \
"
@@ -40,6 +42,9 @@ SRC_URI[sha256sum] = "e528c30b0209c741f6f320cb83122ded92f291802b6a1a1dc1a01dcdb3
S = "${WORKDIR}/${BP}/src"
+SYSTEMD_SERVICE_${PN} = "krb5-admin-server.service krb5-kdc.service"
+SYSTEMD_AUTO_ENABLE = "disable"
+
PACKAGECONFIG ??= "openssl"
PACKAGECONFIG[libedit] = "--with-libedit,--without-libedit,libedit"
PACKAGECONFIG[openssl] = "--with-pkinit-crypto-impl=openssl,,openssl"
@@ -79,20 +84,26 @@ do_configure() {
}
do_install_append() {
- mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default
- install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d
- install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
-
rm -rf ${D}/${localstatedir}/run
- mkdir -p ${D}/${sysconfdir}/default/volatiles
- echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \
- > ${D}${sysconfdir}/default/volatiles/87_krb5
+
+ if ${@bb.utils.contains('DISTRO_FEATURES', 'sysvinit', 'true', 'false', d)}; then
+ mkdir -p ${D}/${sysconfdir}/init.d ${D}/${sysconfdir}/default
+ install -m 0755 ${WORKDIR}/etc/init.d/* ${D}/${sysconfdir}/init.d
+ install -m 0644 ${WORKDIR}/etc/default/* ${D}/${sysconfdir}/default
+
+ mkdir -p ${D}/${sysconfdir}/default/volatiles
+ echo "d root root 0755 ${localstatedir}/run/krb5kdc none" \
+ > ${D}${sysconfdir}/default/volatiles/87_krb5
+ fi
if ${@bb.utils.contains('DISTRO_FEATURES', 'systemd', 'true', 'false', d)}; then
install -d ${D}${sysconfdir}/tmpfiles.d
echo "d /run/krb5kdc - - - -" \
> ${D}${sysconfdir}/tmpfiles.d/krb5.conf
- fi
+ install -d ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/krb5-admin-server.service ${D}${systemd_system_unitdir}
+ install -m 0644 ${WORKDIR}/krb5-kdc.service ${D}${systemd_system_unitdir}
+ fi
}
pkg_postinst_${PN} () {