From patchwork Sat Jul 28 07:21:21 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 173834 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (silver.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 8BF402C007A for ; Sat, 28 Jul 2012 17:22:12 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id B267E26925; Sat, 28 Jul 2012 07:22:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6nHeKz7We7cj; Sat, 28 Jul 2012 07:22:01 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 6D2CA31347; Sat, 28 Jul 2012 07:22:01 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (whitealder.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 7E2B78F783 for ; Sat, 28 Jul 2012 07:21:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 423E98D15E for ; Sat, 28 Jul 2012 07:21:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id a07Xg3QaDNwR for ; Sat, 28 Jul 2012 07:21:55 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [88.190.12.23]) by whitealder.osuosl.org (Postfix) with ESMTP id C50048D22B for ; Sat, 28 Jul 2012 07:21:54 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 106) id C9390246; Sat, 28 Jul 2012 09:21:39 +0200 (CEST) Received: from localhost (unknown [88.238.76.47]) by mail.free-electrons.com (Postfix) with ESMTPSA id 3BEA4B5 for ; Sat, 28 Jul 2012 09:21:30 +0200 (CEST) From: Maxime Ripard To: buildroot@busybox.net Date: Sat, 28 Jul 2012 09:21:21 +0200 Message-Id: X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: In-Reply-To: References: Subject: [Buildroot] [PATCH 2/3] Add systemd unit for lighttpd X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net Signed-off-by: Maxime Ripard --- package/lighttpd/lighttpd.mk | 13 +++++++++++-- package/lighttpd/lighttpd.service | 10 ++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) create mode 100644 package/lighttpd/lighttpd.service diff --git a/package/lighttpd/lighttpd.mk b/package/lighttpd/lighttpd.mk index 9f554cb..c9decb1 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 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