apache2: add systemd unit file

Add systemd unit file for apache2.

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
This commit is contained in:
Chen Qi
2014-08-25 14:47:20 +08:00
committed by Martin Jansa
parent 44834de2a3
commit 49cb17b497
2 changed files with 25 additions and 2 deletions
@@ -18,7 +18,8 @@ SRC_URI = "http://www.apache.org/dist/httpd/httpd-${PV}.tar.bz2 \
file://npn-patch-2.4.7.patch \
file://0001-configure-use-pkg-config-for-PCRE-detection.patch \
file://init \
file://apache2-volatile.conf"
file://apache2-volatile.conf \
file://apache2.service"
LIC_FILES_CHKSUM = "file://LICENSE;md5=dbff5a2b542fa58854455bf1a0b94b83"
SRC_URI[md5sum] = "44543dff14a4ebc1e9e2d86780507156"
@@ -26,7 +27,10 @@ SRC_URI[sha256sum] = "176c4dac1a745f07b7b91e7f4fd48f9c48049fa6f088efe758d61d9738
S = "${WORKDIR}/httpd-${PV}"
inherit autotools update-rc.d pkgconfig
inherit autotools update-rc.d pkgconfig systemd
SYSTEMD_SERVICE_${PN} = "apache2.service"
SYSTEMD_AUTO_ENABLE_${PN} = "disable"
SSTATE_SCAN_FILES += "apxs config_vars.mk config.nice"
@@ -81,6 +85,11 @@ do_install_append() {
install -d ${D}${sysconfdir}/tmpfiles.d/
install -m 0644 ${WORKDIR}/apache2-volatile.conf ${D}${sysconfdir}/tmpfiles.d/
fi
install -d ${D}${systemd_unitdir}/system
install -m 0644 ${WORKDIR}/apache2.service ${D}${systemd_unitdir}/system
sed -i -e 's,@SBINDIR@,${sbindir},g' ${D}${systemd_unitdir}/system/apache2.service
sed -i -e 's,@BASE_BINDIR@,${base_bindir},g' ${D}${systemd_unitdir}/system/apache2.service
}
SYSROOT_PREPROCESS_FUNCS += "apache_sysroot_preprocess"
@@ -0,0 +1,14 @@
[Unit]
Decription=The Apache HTTP Server
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=simple
Environment=LANG=C
ExecStart=@SBINDIR@/httpd -DFOREGROUND -D SSL -D PHP5 -k start
ExecStop=@BASE_BINDIR@/kill -WINCH ${MAINPID}
KillSignal=SIGCONT
PrivateTmp=true
[Install]
WantedBy=multi-user.target