summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Fontaine <fontaine.fabrice@gmail.com>2018-06-22 23:08:58 +0200
committerPeter Korsgaard <peter@korsgaard.com>2018-06-23 09:51:59 +0200
commit2ce4028d5ff53acc56c6f07b4c63ccc9105004d2 (patch)
tree9060e8cc3fcfa6a2bad013a65a79c385ebf5e697
parent28de0c07cf4e92f63a47328369e391241791cdc0 (diff)
downloadbuildroot-2ce4028d5ff53acc56c6f07b4c63ccc9105004d2.tar.gz
buildroot-2ce4028d5ff53acc56c6f07b4c63ccc9105004d2.zip
apache: add systemd init script
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
-rw-r--r--package/apache/apache.mk8
-rw-r--r--package/apache/apache.service13
2 files changed, 21 insertions, 0 deletions
diff --git a/package/apache/apache.mk b/package/apache/apache.mk
index f4c522916e..6ebd30ca40 100644
--- a/package/apache/apache.mk
+++ b/package/apache/apache.mk
@@ -97,4 +97,12 @@ define APACHE_INSTALL_INIT_SYSV
$(TARGET_DIR)/etc/init.d/S50apache
endef
+define APACHE_INSTALL_INIT_SYSTEMD
+ $(INSTALL) -D -m 644 package/apache/apache.service \
+ $(TARGET_DIR)/usr/lib/systemd/system/apache.service
+ mkdir -p $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants
+ ln -sf ../../../../usr/lib/systemd/system/apache.service \
+ $(TARGET_DIR)/etc/systemd/system/multi-user.target.wants/apache.service
+endef
+
$(eval $(autotools-package))
diff --git a/package/apache/apache.service b/package/apache/apache.service
new file mode 100644
index 0000000000..b8747e2658
--- /dev/null
+++ b/package/apache/apache.service
@@ -0,0 +1,13 @@
+[Unit]
+Description=Apache HTTP Server
+After=network.target
+
+[Service]
+Type=forking
+ExecStart=/usr/bin/apachectl start
+ExecReload=/usr/bin/apachectl graceful
+ExecStop=/usr/bin/apachectl stop
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
OpenPOWER on IntegriCloud