From patchwork Wed Aug 28 02:16:25 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1154138 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b2xmJQ/k"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46J8WR241zz9sDQ for ; Wed, 28 Aug 2019 12:16:50 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 9F18A86D7D; Wed, 28 Aug 2019 02:16:47 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 44F56Luzvz-K; Wed, 28 Aug 2019 02:16:47 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id E161486CA6; Wed, 28 Aug 2019 02:16:46 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 462AE1BF348 for ; Wed, 28 Aug 2019 02:16:44 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 43CF185BA7 for ; Wed, 28 Aug 2019 02:16:44 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1CyQvqzLY6nv for ; Wed, 28 Aug 2019 02:16:43 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qk1-f196.google.com (mail-qk1-f196.google.com [209.85.222.196]) by hemlock.osuosl.org (Postfix) with ESMTPS id 0DE9585AB9 for ; Wed, 28 Aug 2019 02:16:43 +0000 (UTC) Received: by mail-qk1-f196.google.com with SMTP id u190so1083288qkh.5 for ; Tue, 27 Aug 2019 19:16:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=O1T01fq394rB3lY1pcV0jAN9/SJ1n5HUjeiQkapbSD8=; b=b2xmJQ/kBIE0n+PuiLJf0m4pAKABg1+rPoyMGOFo3PBO0scQgmyBYMqO8vn72CWs82 BIeQPfv1u9RjzSLd6fGB+HkVgPoJic479TUWbDokEQunU/NvF9Rl9IYExPRDV6bNENy0 y8PsI5VO11BPbvFIXUSh3TN+GUY05X/Y+G816ZSgjHLSVt2aQT78S9Kg07UTPQGw5LuR hy3FAvbzoaoNLpb3txwZBu7eQSHtdQzGkpeQmlhKHQJbqeHuFW2hrYGe1paf2a/WrXyD NKUh0S66WI6TOWZJbXvjz3FUNPmTTqwxgqNpc20osDxOFfKXrItmdNypj1VKwrEsMX9P MAyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=O1T01fq394rB3lY1pcV0jAN9/SJ1n5HUjeiQkapbSD8=; b=G99ZEM0hwlnbqqIST2PXnZdy4Wwl4DhZY+Rw0wdTIXCr7g1y+VNJliE1gdpHnKxHVk FnrouBrZSjEtDQ79J75AUpqOnARMrk/Q5KEpQNHVPccft/aw1ut3hvS7haA7AhfMda2T GtYOlslzGF6qZCj8LPQh6RKbvgVgk/G5SEP2FdMGzi58F31YlC6RYp7j30LReyf+smy0 4utmqnb/tW1US9LNl5bGgBsnSBrb/zPAk83Y8B245lsvV3Ye/QhcZC3aYqR+0jVwuOm5 PWCKUoLXUrZ7Lm2d52SW1F/AynWaHHuCcpXE50LwA68+kDb73eWPK+rZyWHo5Ty0GPg3 sX3g== X-Gm-Message-State: APjAAAWV6qsTeDKXW7IgNTAf0JAVKXOP9ryUGRGNtMn43tsyP7BQQ8lu 8wDoGPBGd8Ni5Y+nE53kgBcyaIjV X-Google-Smtp-Source: APXvYqw7aKWj6SnOAKWfOHlexX7TQDT78kFglzaqmXRKIS9eQv0qTyX7RWlnvh+CI3LQfZd4A23YGA== X-Received: by 2002:a37:b4c4:: with SMTP id d187mr1608482qkf.459.1566958601922; Tue, 27 Aug 2019 19:16:41 -0700 (PDT) Received: from casantos.remote.csb ([177.18.42.89]) by smtp.gmail.com with ESMTPSA id o18sm521638qtb.53.2019.08.27.19.16.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2019 19:16:41 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Tue, 27 Aug 2019 23:16:25 -0300 Message-Id: <20190828021626.9688-2-unixmania@gmail.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20190828021626.9688-1-unixmania@gmail.com> References: <20190828021626.9688-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH 1/2] package/thttpd: fix systemd startup X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Santos MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos Create the configuration file as /etc/thttpd.conf, as expected by the systemd unit file. This matches other web server packages that install configuration files at /etc/lighttpd/, /etc/apache2, etc. Signed-off-by: Carlos Santos --- package/thttpd/thttpd.mk | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/package/thttpd/thttpd.mk b/package/thttpd/thttpd.mk index 29611fff2c..03f148eb35 100644 --- a/package/thttpd/thttpd.mk +++ b/package/thttpd/thttpd.mk @@ -18,13 +18,14 @@ define THTTPD_INSTALL_TARGET_CMDS $(INSTALL) -D -m 0755 $(@D)/extras/syslogtocern $(TARGET_DIR)/usr/bin/syslogtocern $(INSTALL) -D -m 0755 $(@D)/scripts/thttpd_wrapper $(TARGET_DIR)/usr/sbin/thttpd_wrapper $(SED) 's:/usr/local/sbin:/usr/sbin:g' -e \ - 's:/usr/local/www:/var/www:g' $(TARGET_DIR)/usr/sbin/thttpd_wrapper + 's:/usr/local/www/thttpd_config:/etc/thttpd.conf:g' \ + $(TARGET_DIR)/usr/sbin/thttpd_wrapper $(INSTALL) -d $(TARGET_DIR)/var/www/data $(INSTALL) -d $(TARGET_DIR)/var/www/logs - echo "dir=/var/www/data" > $(TARGET_DIR)/var/www/thttpd_config - echo 'cgipat=**.cgi' >> $(TARGET_DIR)/var/www/thttpd_config - echo "logfile=/var/www/logs/thttpd_log" >> $(TARGET_DIR)/var/www/thttpd_config - echo "pidfile=/var/run/thttpd.pid" >> $(TARGET_DIR)/var/www/thttpd_config + echo "dir=/var/www/data" > $(TARGET_DIR)/etc/thttpd.conf + echo 'cgipat=**.cgi' >> $(TARGET_DIR)/etc/thttpd.conf + echo "logfile=/var/www/logs/thttpd_log" >> $(TARGET_DIR)/etc/thttpd.conf + echo "pidfile=/var/run/thttpd.pid" >> $(TARGET_DIR)/etc/thttpd.conf endef define THTTPD_INSTALL_INIT_SYSV From patchwork Wed Aug 28 02:16:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Carlos Santos X-Patchwork-Id: 1154139 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="TpKeuXiV"; dkim-atps=neutral Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46J8WV484Gz9sBp for ; Wed, 28 Aug 2019 12:16:54 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 5ED5086DC0; Wed, 28 Aug 2019 02:16:50 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RkVYyjFAsrQj; Wed, 28 Aug 2019 02:16:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0D89A86D80; Wed, 28 Aug 2019 02:16:48 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B8EAC1BF348 for ; Wed, 28 Aug 2019 02:16:45 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B62A687801 for ; Wed, 28 Aug 2019 02:16:45 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oWX8LcUoARSj for ; Wed, 28 Aug 2019 02:16:45 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-qt1-f195.google.com (mail-qt1-f195.google.com [209.85.160.195]) by whitealder.osuosl.org (Postfix) with ESMTPS id DB9E887729 for ; Wed, 28 Aug 2019 02:16:44 +0000 (UTC) Received: by mail-qt1-f195.google.com with SMTP id g4so1271585qtq.7 for ; Tue, 27 Aug 2019 19:16:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=e7NgLVSEsIJ3js7y22HvxAfmcsO+9pCHiac8+0JoSlM=; b=TpKeuXiVkz5ExhbQ+/5oI80IPFjw3/E7v5c4MFaUArtQkNP9ktdm1e6YVto1zZNWm8 JBGhkwriAkrjJDUuBo7OiWpaaGVb4KGIxYemUXWPnDbO6gOXSS5NXN7pKOFyc9ZsZQOc NBnIE2vbZgdnZoPeFHdWVx8Ie84s0YNcok0DoUVW8+dtWCs0u563fHaQ+1PmXAix1MN4 EhVZaUMYTqcehoXDc/hGIxKOHJ5VxokGCnTnMNa3hWrvhW2ewhsszSHCRiJpvlKG6F1T NmioWE/X3o1epE7decCYhSHyrqvLSEN364FUAQu1jvxYN5iuErWzDgUXR98zugLEYUBW SOfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=e7NgLVSEsIJ3js7y22HvxAfmcsO+9pCHiac8+0JoSlM=; b=Og+YXt98RUxK+lePVMFof9EmYsPBnXOH4zVE5nbf8SYC/03m/ch79PnQYOFR8cCm5P E5sA8BotFcHswN79DcpmABZ8K8E/fmABPiwDvzeWLMP2RkZU8d2fBxs8zzFn9mk7yM1p JCRlLAHZUwb2N+l2gTERZV38hpcrnqIBRYoDuESuU3WarNtBFUN1yKiLNrt9VWB+V9O0 JlEC/Pjy3r+FLsItD5jZF6dvxUWLGimWNweROazrikDutybAIP3SzeSUYWHDXoZveSDC pPiV20puuf2wD5+H8vyXsStnAHk9PEQum5KHIPp7oM7mJa+owgTQKyz23852iiqeGtsa nBcw== X-Gm-Message-State: APjAAAU0FTEOA0EpovoYAvyfmNUYchAsC/4qU1HaACDuT+eJ1R54X6l4 RBWos5DF6b5FQFXbanlSgKSAzX8L X-Google-Smtp-Source: APXvYqwcln8xn5Zn0KquKn2y4kBPS+6YN0XpzVwcKsxeTCxGgtAGaToa17VsDA3SiZ80i+JoYFYe8Q== X-Received: by 2002:aed:3ed5:: with SMTP id o21mr2047723qtf.369.1566958603712; Tue, 27 Aug 2019 19:16:43 -0700 (PDT) Received: from casantos.remote.csb ([177.18.42.89]) by smtp.gmail.com with ESMTPSA id o18sm521638qtb.53.2019.08.27.19.16.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Aug 2019 19:16:43 -0700 (PDT) From: unixmania@gmail.com To: buildroot@buildroot.org Date: Tue, 27 Aug 2019 23:16:26 -0300 Message-Id: <20190828021626.9688-3-unixmania@gmail.com> X-Mailer: git-send-email 2.18.1 In-Reply-To: <20190828021626.9688-1-unixmania@gmail.com> References: <20190828021626.9688-1-unixmania@gmail.com> Subject: [Buildroot] [PATCH 2/2] package/thttpd: fix init script X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Carlos Santos MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Carlos Santos The init script provided by thttpd is for FreeBSD. Add a custom one, maade specifically for Buirdroot. Signed-off-by: Carlos Santos --- package/thttpd/S90thttpd | 54 ++++++++++++++++++++++++++++++++++++++++ package/thttpd/thttpd.mk | 4 +-- 2 files changed, 56 insertions(+), 2 deletions(-) create mode 100644 package/thttpd/S90thttpd diff --git a/package/thttpd/S90thttpd b/package/thttpd/S90thttpd new file mode 100644 index 0000000000..94b079b050 --- /dev/null +++ b/package/thttpd/S90thttpd @@ -0,0 +1,54 @@ +#!/bin/sh + +DAEMON="thttpd" +PIDFILE="/var/run/$DAEMON.pid" + +THTTPD_ARGS="-C /etc/thttpd.conf" + +# shellcheck source=/dev/null +[ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON" + +start() { + printf 'Starting %s: ' "$DAEMON" + # shellcheck disable=SC2086 # we need the word splitting + start-stop-daemon -S -q -p "$PIDFILE" -x "/usr/sbin/$DAEMON" \ + -- $THTTPD_ARGS + status=$? + if [ "$status" -eq 0 ]; then + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +stop() { + printf 'Stopping %s: ' "$DAEMON" + start-stop-daemon -K -q -p "$PIDFILE" + status=$? + if [ "$status" -eq 0 ]; then + # thttpd does not remove the pid file on exit + rm -f "$PIDFILE" + echo "OK" + else + echo "FAIL" + fi + return "$status" +} + +restart() { + stop + sleep 1 + start +} + +case "$1" in + start|stop|restart) + "$1";; + reload) + # Restart, since there is no true "reload" feature. + restart;; + *) + echo "Usage: $0 {start|stop|restart|reload}" + exit 1 +esac diff --git a/package/thttpd/thttpd.mk b/package/thttpd/thttpd.mk index 03f148eb35..6cf86e4b95 100644 --- a/package/thttpd/thttpd.mk +++ b/package/thttpd/thttpd.mk @@ -29,8 +29,8 @@ define THTTPD_INSTALL_TARGET_CMDS endef define THTTPD_INSTALL_INIT_SYSV - $(INSTALL) -D -m 0755 $(@D)/scripts/thttpd.sh $(TARGET_DIR)/etc/init.d/S90thttpd - $(SED) 's:/usr/local/sbin:/usr/sbin:g' $(TARGET_DIR)/etc/init.d/S90thttpd + $(INSTALL) -D -m 0755 package/thttpd/S90thttpd \ + $(TARGET_DIR)/etc/init.d/S90thttpd endef define THTTPD_INSTALL_INIT_SYSTEMD