aboutsummaryrefslogtreecommitdiffstats
path: root/meta-webserver
diff options
context:
space:
mode:
authorChen Qi <Qi.Chen@windriver.com>2017-08-22 17:57:38 +0800
committerMartin Jansa <Martin.Jansa@gmail.com>2017-08-28 11:06:04 +0200
commit1f9601bd037507eb4ca02cb738749a2739eb82eb (patch)
treeb66635930816d36ab4e3b7041b396f3baeda01ec /meta-webserver
parent49d17c6533b1b9d5ed485e101564baa1a44a9f90 (diff)
downloadmeta-openembedded-contrib-1f9601bd037507eb4ca02cb738749a2739eb82eb.tar.gz
meta-openembedded-contrib-1f9601bd037507eb4ca02cb738749a2739eb82eb.tar.bz2
meta-openembedded-contrib-1f9601bd037507eb4ca02cb738749a2739eb82eb.zip
webmin: add systemd service file
Add systemd service file for webmin. Signed-off-by: Chen Qi <Qi.Chen@windriver.com> Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Diffstat (limited to 'meta-webserver')
-rw-r--r--meta-webserver/recipes-webadmin/webmin/files/webmin.service15
-rw-r--r--meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb11
2 files changed, 25 insertions, 1 deletions
diff --git a/meta-webserver/recipes-webadmin/webmin/files/webmin.service b/meta-webserver/recipes-webadmin/webmin/files/webmin.service
new file mode 100644
index 0000000000..87cf4f99d0
--- /dev/null
+++ b/meta-webserver/recipes-webadmin/webmin/files/webmin.service
@@ -0,0 +1,15 @@
+[Unit]
+Description=Webmin Admin Tool
+Requires=local-fs.target
+After=basic.target
+Conflicts=shutdown.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStart=@SYSCONFDIR@/webmin/start
+ExecStop=@SYSCONFDIR@/webmin/stop
+ExecReload=@SYSCONFDIR@/webmin/reload
+
+[Install]
+WantedBy=multi-user.target
diff --git a/meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb b/meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb
index 6acff033a7..ae88eb6737 100644
--- a/meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb
+++ b/meta-webserver/recipes-webadmin/webmin/webmin_1.850.bb
@@ -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] = "cd6ee98f73f9418562197675b952d81b"
SRC_URI[sha256sum] = "c66caa9e4cb50d5447bc8aceb7989d2284dde060278f404b13e171c7ce1690e1"
-inherit perlnative update-rc.d
+inherit perlnative update-rc.d systemd
do_configure() {
# Remove binaries and plugins for other platforms
@@ -77,6 +78,11 @@ 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,@SYSCONFDIR@,${sysconfdir},g' \
+ ${D}${systemd_unitdir}/system/webmin.service
+
install -d ${D}${localstatedir}
install -d ${D}${localstatedir}/webmin
@@ -117,6 +123,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"