Skip to contentSkip to conversation

tftp-hpa: add systemd unit files

PATCH New [email protected] 1 participant 2 messages Sep 28, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tftp-hpa: add systemd unit files

From: Chen Qi <[email protected]>

Add systemd unit files for tftp-hpa.

---
 .../recipes-daemons/tftp-hpa/files/tftpd-hpa.service         | 10 ++++++++++
 .../recipes-daemons/tftp-hpa/files/tftpd-hpa.socket          |  8 ++++++++
 meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb     | 12 +++++++++++-
 3 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service
 create mode 100644 meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket
meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.service new file +10 -0
new file mode 100644
index 0000000..97d5658
@@ -0,0 +1,10 @@
+[Unit]
+Description=Tftp Server
+Requires=tftpd-hpa.socket
+
+[Service]
+ExecStart=@SBINDIR@/in.tftpd-hpa -s /var/lib/tftpboot
+StandardInput=socket
+
+[Install]
+Also=tftpd-hpa.socket
meta-networking/recipes-daemons/tftp-hpa/files/tftpd-hpa.socket new file +8 -0
new file mode 100644
index 0000000..8764c1d
@@ -0,0 +1,8 @@
+[Unit]
+Description=Tftp Server Activation Socket
+
+[Socket]
+ListenDatagram=69
+
+[Install]
+WantedBy=sockets.target
meta-networking/recipes-daemons/tftp-hpa/tftp-hpa_5.2.bb +11 -1
index 115fa2e..60b2f6b 100644
@@ -26,12 +26,14 @@ SRC_URI = "http://kernel.org/pub/software/network/tftp/tftp-hpa/tftp-hpa-${PV}.t
            file://add-error-check-for-disk-filled-up.patch \
            file://tftp-hpa-bug-fix-on-separated-CR-and-LF.patch \
            file://fix-writing-emtpy-file.patch \
+           file://tftpd-hpa.socket \
+           file://tftpd-hpa.service \
 "
 
 SRC_URI[md5sum] = "46c9bd20bbffa62f79c958c7b99aac21"
 SRC_URI[sha256sum] = "0a9f88d4c1c02687b4853b02ab5dd8779d4de4ffdb9b2e5c9332841304d1a269"
 
-inherit autotools-brokensep update-rc.d update-alternatives
+inherit autotools-brokensep update-rc.d update-alternatives systemd
 
 export AR = "${HOST_PREFIX}ar cq"
 
@@ -60,6 +62,11 @@ do_install() {
 
     install -d ${D}${sysconfdir}/default
     install -m 0644 ${WORKDIR}/default ${D}${sysconfdir}/default/tftpd-hpa
+
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/tftpd-hpa.socket ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/tftpd-hpa.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/tftpd-hpa.service
 }
 
 FILES_${PN} = "${bindir}"
@@ -77,3 +84,6 @@ ALTERNATIVE_${PN} = "tftp"
 ALTERNATIVE_TARGET[tftp] = "${bindir}/tftp-hpa"
 ALTERNATIVE_PRIORITY = "50"
 
+SYSTEMD_PACKAGES = "tftp-hpa-server"
+SYSTEMD_SERVICE_tftp-hpa-server = "tftpd-hpa.socket tftpd-hpa.service"
+SYSTEMD_AUTO_ENABLE_tftp-hpa-server = "enable"
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/2 webmin: add systemd service file

From: Chen Qi <[email protected]>

Add systemd service file for webmin.

---
 .../recipes-webadmin/webmin/files/webmin.service           | 14 ++++++++++++++
 meta-webserver/recipes-webadmin/webmin/webmin_1.801.bb     | 12 +++++++++++-
 2 files changed, 25 insertions(+), 1 deletion(-)
 create mode 100644 meta-webserver/recipes-webadmin/webmin/files/webmin.service
meta-webserver/recipes-webadmin/webmin/files/webmin.service new file +14 -0
new file mode 100644
index 0000000..904bf79
@@ -0,0 +1,14 @@
+[Unit]
+Description=Webmin Admin Tool
+Requires=local-fs.target
+After=basic.target
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshot
+ExecStart=@LIBEXECDIR@/webmin/miniserv.pl @SYSCONFDIR@/webmin/miniserv.conf
+RemainAfterExit=yes
+PrivateTmp=true
+
+[Install]
+WantedBy=multi-user.target
meta-webserver/recipes-webadmin/webmin/webmin_1.801.bb +11 -1
index 3fc083a..05b5b92 100644
@@ -18,12 +18,13 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/webadmin/webmin-${PV}.tar.gz \
            file://media-tomb.patch \
            file://remove-python2.3.patch \
            file://mysql-config-fix.patch \
+           file://webmin.service \
             "
 
 SRC_URI[md5sum] = "91d05b4e31ad1bd14bab14e0f155c088"
 SRC_URI[sha256sum] = "ad477edb41dc1a900448afc8b5528e136b3778d2d303f23bc564afb975eb5bed"
 
-inherit perlnative update-rc.d
+inherit perlnative update-rc.d systemd
 
 do_configure() {
     # Remove binaries and plugins for other platforms
@@ -77,6 +78,12 @@ do_install() {
     install -d ${D}${sysconfdir}/init.d
     install -m 0755 webmin-init ${D}${sysconfdir}/init.d/webmin
 
+    install -d ${D}${systemd_unitdir}/system
+    install -m 0644 ${WORKDIR}/webmin.service ${D}${systemd_unitdir}/system
+    sed -i -e 's,@LIBEXECDIR@,${libexecdir},g' \
+           -e 's,@SYSCONFDIR@,${sysconfdir},g' \
+           ${D}${systemd_unitdir}/system/webmin.service
+
     install -d ${D}${localstatedir}
     install -d ${D}${localstatedir}/webmin
 
@@ -114,6 +121,9 @@ do_install() {
 INITSCRIPT_NAME = "webmin"
 INITSCRIPT_PARAMS = "start 99 5 3 2 . stop 10 0 1 6 ."
 
+SYSTEMD_SERVICE_${PN} = "webmin.service"
+SYSTEMD_AUTO_ENABLE_${PN} = "disable"
+
 # FIXME: some of this should be figured out automatically
 RDEPENDS_${PN} += "perl perl-module-socket perl-module-exporter perl-module-exporter-heavy perl-module-carp perl-module-strict"
 RDEPENDS_${PN} += "perl-module-warnings perl-module-xsloader perl-module-posix perl-module-autoloader"
Signature · 1 line
1.9.1