]> code.ossystems Code Review - openembedded-core.git/commitdiff
xinetd: add systemd unit file
authorChong Lu <Chong.Lu@windriver.com>
Tue, 9 Sep 2014 05:32:36 +0000 (13:32 +0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 4 Nov 2014 10:19:54 +0000 (10:19 +0000)
Add systemd unit file for xinetd.

Signed-off-by: Chong Lu <Chong.Lu@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
meta/recipes-extended/xinetd/xinetd/xinetd.service [new file with mode: 0644]
meta/recipes-extended/xinetd/xinetd_2.3.15.bb

diff --git a/meta/recipes-extended/xinetd/xinetd/xinetd.service b/meta/recipes-extended/xinetd/xinetd/xinetd.service
new file mode 100644 (file)
index 0000000..d5fdc5b
--- /dev/null
@@ -0,0 +1,13 @@
+[Unit]
+Description=Xinetd A Powerful Replacement For Inetd
+After=syslog.target network.target
+
+[Service]
+Type=forking
+PIDFile=/var/run/xinetd.pid
+EnvironmentFile=-/etc/sysconfig/xinetd
+ExecStart=@SBINDIR@/xinetd -stayalive -pidfile /var/run/xinetd.pid "$EXTRAOPTIONS"
+ExecReload=@BASE_BINDIR@/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target
index 1928949e94d4b9d2928ec2442c017459877eab08..288186e1bab5535d9500a3256ac0e764c1f43fab 100644 (file)
@@ -17,12 +17,15 @@ SRC_URI = "http://www.xinetd.org/xinetd-${PV}.tar.gz \
       file://Disable-services-from-inetd.conf-if-a-service-with-t.patch \
       file://xinetd-should-be-able-to-listen-on-IPv6-even-in-ine.patch \
       file://xinetd-CVE-2013-4342.patch \
+      file://xinetd.service \
       "
 
 SRC_URI[md5sum] = "77358478fd58efa6366accae99b8b04c"
 SRC_URI[sha256sum] = "bf4e060411c75605e4dcbdf2ac57c6bd9e1904470a2f91e01ba31b50a80a5be3"
 
-inherit autotools update-rc.d
+inherit autotools update-rc.d systemd
+
+SYSTEMD_SERVICE_${PN} = "xinetd.service"
 
 INITSCRIPT_NAME = "xinetd"
 INITSCRIPT_PARAMS = "defaults"
@@ -52,6 +55,13 @@ do_install() {
        install -m 644 "${WORKDIR}/xinetd.default" "${D}${sysconfdir}/default/xinetd"
        install -m 755 "${B}/xinetd/xinetd" "${D}${sbindir}"
        install -m 755 "${B}/xinetd/itox" "${D}${sbindir}"
+
+       # Install systemd unit files
+       install -d ${D}${systemd_unitdir}/system
+       install -m 0644 ${WORKDIR}/xinetd.service ${D}${systemd_unitdir}/system
+       sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' \
+              -e 's,@SBINDIR@,${sbindir},g' \
+              ${D}${systemd_unitdir}/system/xinetd.service
 }
 
 CONFFILES_${PN} = "${sysconfdir}/xinetd.conf"