apache: add systemd init script
authorFabrice Fontaine <fontaine.fabrice@gmail.com>
Fri, 22 Jun 2018 21:08:58 +0000 (23:08 +0200)
committerPeter Korsgaard <peter@korsgaard.com>
Sat, 23 Jun 2018 07:51:59 +0000 (09:51 +0200)
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
package/apache/apache.mk
package/apache/apache.service [new file with mode: 0644]

index f4c522916e9be29d37fb2abc42d6e74f289d27be..6ebd30ca40e8fd03eb9fed4caa9c38b7a5195c5b 100644 (file)
@@ -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 (file)
index 0000000..b8747e2
--- /dev/null
@@ -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