[oe-commits] Roy Li : proftpd: add systemd support

git at git.openembedded.org git at git.openembedded.org
Mon Feb 9 12:29:43 UTC 2015


Module: meta-openembedded.git
Branch: master-next
Commit: 2072c0d5244e7c6a6c5eed0f620f25ec838cb8ee
URL:    http://git.openembedded.org/?p=meta-openembedded.git&a=commit;h=2072c0d5244e7c6a6c5eed0f620f25ec838cb8ee

Author: Roy Li <rongqing.li at windriver.com>
Date:   Mon Feb  9 10:39:20 2015 +0800

proftpd: add systemd support

Signed-off-by: Roy Li <rongqing.li at windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa at gmail.com>

---

 .../recipes-daemons/proftpd/files/proftpd.service         |  7 +++++++
 meta-networking/recipes-daemons/proftpd/proftpd_1.3.5.bb  | 15 +++++++++++++--
 2 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/meta-networking/recipes-daemons/proftpd/files/proftpd.service b/meta-networking/recipes-daemons/proftpd/files/proftpd.service
new file mode 100644
index 0000000..ba97f8e
--- /dev/null
+++ b/meta-networking/recipes-daemons/proftpd/files/proftpd.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=proftpd Daemon
+
+[Service]
+Type=forking
+ExecStart=- at SBINDIR@/proftpd -c @SYSCONFDIR@/proftpd.conf
+StandardError=syslog
diff --git a/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5.bb b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5.bb
index cba39e8..ca629be 100644
--- a/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5.bb
+++ b/meta-networking/recipes-daemons/proftpd/proftpd_1.3.5.bb
@@ -11,12 +11,13 @@ SRC_URI = "ftp://ftp.proftpd.org/distrib/source/${BPN}-${PV}.tar.gz \
            file://close-RequireValidShell-check.patch \
            file://contrib.patch  \
            file://build_fixup.patch \
-           "
+           file://proftpd.service \
+		   "
 
 SRC_URI[md5sum] = "aff1bff40e675244d72c4667f203e5bb"
 SRC_URI[sha256sum] = "c10316fb003bd25eccbc08c77dd9057e053693e6527ffa2ea2cc4e08ccb87715"
 
-inherit autotools-brokensep useradd update-rc.d
+inherit autotools-brokensep useradd update-rc.d systemd
 
 PACKAGECONFIG ??= "sia shadow"
 PACKAGECONFIG += " ${@bb.utils.contains('DISTRO_FEATURES', 'ipv6', 'ipv6', '', d)}"
@@ -87,11 +88,21 @@ do_install () {
     # create the pub directory
     mkdir -p ${D}/home/${FTPUSER}/pub/
     chown -R ${FTPUSER}:${FTPGROUP} ${D}/home/${FTPUSER}/pub
+
+    install -d ${D}/${systemd_unitdir}/system
+    install -m 644 ${WORKDIR}/proftpd.service ${D}/${systemd_unitdir}/system
+    sed -e 's, at BASE_SBINDIR@,${base_sbindir},g' \
+        -e 's, at SYSCONFDIR@,${sysconfdir},g' \
+        -e 's, at SBINDIR@,${sbindir},g' \
+        -i ${D}${systemd_unitdir}/system/*.service
 }
 
 INITSCRIPT_NAME = "proftpd"
 INITSCRIPT_PARAM = "defaults 85 15"
 
+SYSTEMD_PACKAGES = "${PN}"
+SYSTEMD_SERVICE_${PN} = "proftpd.service"
+
 USERADD_PACKAGES = "${PN}"
 GROUPADD_PARAM_${PN} = "--system ${FTPGROUP}"
 USERADD_PARAM_${PN} = "--system -g ${FTPGROUP} --home-dir /var/lib/${FTPUSER} --no-create-home \



More information about the Openembedded-commits mailing list