From patchwork Fri Mar 23 15:49:56 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [5/5] Add systemd unit for lighttpd X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 148463 Message-Id: <053f11e835302a883caf833069064f98e32fe4bf.1332517726.git.maxime.ripard@free-electrons.com> To: buildroot@busybox.net Date: Fri, 23 Mar 2012 16:49:56 +0100 From: Maxime Ripard List-Id: Discussion and development of buildroot Signed-off-by: Maxime Ripard --- package/lighttpd/lighttpd.mk | 11 +++++++++++ package/lighttpd/lighttpd.service | 10 ++++++++++ 2 files changed, 21 insertions(+), 0 deletions(-) create mode 100644 package/lighttpd/lighttpd.service diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk index 8d1f212..1f2f283 100644 --- a/package/lighttpd/lighttpd.mk +++ b/package/lighttpd/lighttpd.mk @@ -88,6 +88,17 @@ endef LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_CONFIG +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 -f $(TARGET_DIR)/usr/sbin/lighttpd rm -f $(TARGET_DIR)/usr/sbin/lighttpd-angel diff --git a/package/lighttpd/lighttpd.service b/package/lighttpd/lighttpd.service new file mode 100644 index 0000000..0ca5357 --- /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