summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorMaxime Ripard <maxime.ripard@free-electrons.com>2012-07-28 09:21:21 +0200
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>2012-07-30 23:12:17 +0200
commitb7eb4104b32a6cfca15c081649065659da75d9c1 (patch)
tree5e86df84e3bad665efac8d2217283925b962bb3c /package
parentc92aacd330366da803b1cf37ecb3af816bedd7f2 (diff)
Add systemd unit for lighttpd
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Diffstat (limited to 'package')
-rw-r--r--package/lighttpd/lighttpd.mk13
-rw-r--r--package/lighttpd/lighttpd.service10
2 files changed, 21 insertions, 2 deletions
diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk
index 9f554cbc3..c9decb185 100644
--- a/package/lighttpd/lighttpd.mk
+++ b/package/lighttpd/lighttpd.mk
@@ -87,13 +87,22 @@ endef
LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_CONFIG
-define LIGHTTPD_INSTALL_INIT_SCRIPT
+define LIGHTTPD_INSTALL_INIT_SYSV
[ -f $(TARGET_DIR)/etc/init.d/S50lighttpd ] || \
$(INSTALL) -D -m 755 package/lighttpd/S50lighttpd \
$(TARGET_DIR)/etc/init.d/S50lighttpd
endef
-LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_INIT_SCRIPT
+define LIGHTTPD_INSTALL_INIT_SYSTEMD
+ [ -f $(TARGET_DIR)/etc/systemd/system/lighttpd.service ] || \
+ $(INSTALL) -D -m 755 package/lighttpd/lighttpd.service \
+ $(TARGET_DIR)/etc/systemd/system/lighttpd.service
+
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+
+ ln -fs ../lighttpd.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/lighttpd.service
+endef
define LIGHTTPD_UNINSTALL_TARGET_CMDS
$(RM) $(TARGET_DIR)/usr/sbin/lighttpd
diff --git a/package/lighttpd/lighttpd.service b/package/lighttpd/lighttpd.service
new file mode 100644
index 000000000..0ca5357f5
--- /dev/null
+++ b/package/lighttpd/lighttpd.service
@@ -0,0 +1,10 @@
+[Unit]
+Description=Lighttpd Web Server
+After=network.target
+
+[Service]
+ExecStart=/usr/sbin/lighttpd-angel -f /etc/lighttpd/lighttpd.conf -D
+ExecReload=/bin/kill -HUP $MAINPID
+
+[Install]
+WantedBy=multi-user.target