All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christopher McCrory <chrismcc@gmail.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 2/2] apache init script
Date: Tue, 27 Feb 2018 03:50:22 -0800	[thread overview]
Message-ID: <20180227115022.8802-1-chrismcc@gmail.com> (raw)

This patches and installs the included init script.  The script mostly works, but could use a little more editing.

Signed-off-by: Christopher McCrory <chrismcc@gmail.com>
---
 package/apache/0003-init-script.patch | 56 +++++++++++++++++++++++++++++++++++
 package/apache/apache.mk              |  6 ++++
 2 files changed, 62 insertions(+)
 create mode 100644 package/apache/0003-init-script.patch

diff --git a/package/apache/0003-init-script.patch b/package/apache/0003-init-script.patch
new file mode 100644
index 0000000000..1d7a6a022a
--- /dev/null
+++ b/package/apache/0003-init-script.patch
@@ -0,0 +1,56 @@
+--- apache-2.4.29/build/rpm/httpd.init.orig	2018-02-26 01:04:07.243097556 -0800
++++ apache-2.4.29/build/rpm/httpd.init	2018-02-26 01:50:18.311683909 -0800
+@@ -22,7 +22,7 @@
+ # description: The Apache HTTP Server is an efficient and extensible  \
+ #             server implementing the current HTTP standards.
+ # processname: httpd
+-# pidfile: /var/run/httpd.pid
++# pidfile: /var/logs/httpd.pid
+ # config: /etc/sysconfig/httpd
+ #
+ ### BEGIN INIT INFO
+@@ -36,7 +36,7 @@
+ ### END INIT INFO
+ 
+ # Source function library.
+-. /etc/rc.d/init.d/functions
++#. /etc/rc.d/init.d/functions
+ 
+ # What were we called? Multiple instances of the same daemon can be
+ # created by creating suitably named symlinks to this startup script
+@@ -58,13 +58,13 @@
+ # work correctly with a thread-based MPM; notably PHP will refuse to start.
+ 
+ httpd=${HTTPD-/usr/sbin/httpd}
+-pidfile=${PIDFILE-/var/run/${prog}.pid}
+-lockfile=${LOCKFILE-/var/lock/subsys/${prog}}
++pidfile=${PIDFILE-/var/logs/httpd.pid}
++lockfile=${LOCKFILE-/var/lock/httpd}
+ RETVAL=0
+ 
+ # check for 1.3 configuration
+ check13 () {
+-	CONFFILE=/etc/httpd/conf/httpd.conf
++	CONFFILE=/etc/apache2/httpd.conf
+ 	GONE="(ServerType|BindAddress|Port|AddModule|ClearModuleList|"
+ 	GONE="${GONE}AgentLog|RefererLog|RefererIgnore|FancyIndexing|"
+ 	GONE="${GONE}AccessConfig|ResourceConfig)"
+@@ -85,7 +85,8 @@
+ start() {
+         echo -n $"Starting $prog: "
+         check13 || exit 1
+-        LANG=$HTTPD_LANG daemon --pidfile=${pidfile} $httpd $OPTIONS
++        LANG=$HTTPD_LANG start-stop-daemon -S -q --pidfile=${pidfile} -x $httpd -- $OPTIONS
++
+         RETVAL=$?
+         echo
+         [ $RETVAL = 0 ] && touch ${lockfile}
+@@ -93,7 +94,7 @@
+ }
+ stop() {
+ 	echo -n $"Stopping $prog: "
+-	killproc -p ${pidfile} -d 10 $httpd
++	start-stop-daemon -K -p ${pidfile}
+ 	RETVAL=$?
+ 	echo
+ 	[ $RETVAL = 0 ] && rm -f ${lockfile} ${pidfile}
diff --git a/package/apache/apache.mk b/package/apache/apache.mk
index 010ec31c33..5921d48b18 100644
--- a/package/apache/apache.mk
+++ b/package/apache/apache.mk
@@ -82,6 +82,12 @@ define APACHE_FIX_STAGING_APACHE_CONFIG
 endef
 APACHE_POST_INSTALL_STAGING_HOOKS += APACHE_FIX_STAGING_APACHE_CONFIG
 
+define APACHE_INSTALL_INIT_SCRIPT
+	$(INSTALL) -D -m 0755 $(@D)/build/rpm/httpd.init \
+	 $(TARGET_DIR)/etc/init.d/S85httpd
+endef
+APACHE_POST_INSTALL_TARGET_HOOKS += APACHE_INSTALL_INIT_SCRIPT
+
 define APACHE_CLEANUP_TARGET
 	$(RM) -rf $(TARGET_DIR)/usr/manual $(TARGET_DIR)/usr/build
 endef
-- 
2.14.3

             reply	other threads:[~2018-02-27 11:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-27 11:50 Christopher McCrory [this message]
2018-02-27 21:18 ` [Buildroot] [PATCH 2/2] apache init script Thomas Petazzoni
2018-03-02 17:08   ` Christopher McCrory
2018-03-02 20:08     ` Thomas Petazzoni
2018-03-01 19:55 ` Arnout Vandecappelle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180227115022.8802-1-chrismcc@gmail.com \
    --to=chrismcc@gmail.com \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.