Skip to contentSkip to conversation

apache: add init sysv script

PATCH New Fabrice Fontaine 4 participants 4 messages Jun 20, 2018 – Jun 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 apache: add init sysv script

sysv init script is just a wrapper to apachectl

---
 package/apache/S50apache | 12 ++++++++++++
 package/apache/apache.mk |  5 +++++
 2 files changed, 17 insertions(+)
 create mode 100644 package/apache/S50apache
package/apache/S50apache new file +12 -0
new file mode 100644
index 0000000000..623a7eef3b
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+case "$1" in
+  start|restart|graceful|graceful-stop|stop)
+	apachectl -k $1
+	;;
+  *)
+	echo "Usage: $0 {start|restart|graceful|graceful-stop|stop}"
+	exit 1
+esac
+
+exit $?
package/apache/apache.mk +5 -0
index 23414fe44d..f4c522916e 100644
@@ -92,4 +92,9 @@ define APACHE_CLEANUP_TARGET
 endef
 APACHE_POST_INSTALL_TARGET_HOOKS += APACHE_CLEANUP_TARGET
 
+define APACHE_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/apache/S50apache \
+		$(TARGET_DIR)/etc/init.d/S50apache
+endef
+
 $(eval $(autotools-package))
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/1 apache: add init sysv script

Quoted 46 lines

From: "Fabrice Fontaine" <[email protected]>
To: "buildroot" <[email protected]>
Cc: "Fabrice Fontaine" <[email protected]>
Sent: Wednesday, June 20, 2018 6:00:21 PM
Subject: [Buildroot] [PATCH 1/1] apache: add init sysv script

sysv init script is just a wrapper to apachectl

---
package/apache/S50apache | 12 ++++++++++++
package/apache/apache.mk | 5 +++++

2 files changed, 17 insertions(+)

create mode 100644 package/apache/S50apache

package/apache/S50apache new file +12 -0
new file mode 100644
index 0000000000..623a7eef3b
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+case "$1" in
+  start|restart|graceful|graceful-stop|stop)
+	apachectl -k $1
+	;;
+  *)
+	echo "Usage: $0 {start|restart|graceful|graceful-stop|stop}"
+	exit 1
+esac
+
+exit $?
package/apache/apache.mk +0 -0
index 23414fe44d..f4c522916e 100644
@@ -92,4 +92,9 @@ define APACHE_CLEANUP_TARGET

endef
APACHE_POST_INSTALL_TARGET_HOOKS += APACHE_CLEANUP_TARGET

package/apache/apache.mk +5 -0
+define APACHE_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/apache/S50apache \
+		$(TARGET_DIR)/etc/init.d/S50apache
+endef
+
Quoted 3 lines

$(eval $(autotools-package))
--
2.14.1

Built a VM and tested all options. Looks good to me. Do you intend to add the corresponding systemd service configuration?

Signature · 3 lines
Carlos Santos (Casantos) - DATACOM, P&D
?Marched towards the enemy, spear upright, armed with the certainty
that only the ignorant can have.? ? Epitaph of a volunteer
#3 lore raw

PATCH 1/1 apache: add init sysv script

In reply to Fabrice Fontaine
Quoted 15 lines · Fabrice Fontaine

sysv init script is just a wrapper to apachectl

---
 package/apache/S50apache | 12 ++++++++++++
 package/apache/apache.mk |  5 +++++
 2 files changed, 17 insertions(+)
 create mode 100644 package/apache/S50apache
package/apache/S50apache new file +0 -0
new file mode 100644
index 0000000000..623a7eef3b

package/apache/S50apache line 8

Quoted 8 lines
package/apache/S50apache new file +8 -0
@@ -0,0 +1,12 @@
+#!/bin/sh
+
+case "$1" in
+  start|restart|graceful|graceful-stop|stop)
+	apachectl -k $1
+	;;
+  *)
+	echo "Usage: $0 {start|restart|graceful|graceful-stop|stop}"

In our "init script standardisation" effort, I think the idea was to always
support start, stop, restart and reload. Could you add a reload command that maps onto restart?

Regards,
Arnout

Quoted 19 lines
package/apache/S50apache new file +4 -0
+	exit 1
+esac
+
+exit $?
package/apache/apache.mk +5 -0
index 23414fe44d..f4c522916e 100644
@@ -92,4 +92,9 @@ define APACHE_CLEANUP_TARGET
 endef
 APACHE_POST_INSTALL_TARGET_HOOKS += APACHE_CLEANUP_TARGET
 
+define APACHE_INSTALL_INIT_SYSV
+	$(INSTALL) -D -m 0755 package/apache/S50apache \
+		$(TARGET_DIR)/etc/init.d/S50apache
+endef
+
 $(eval $(autotools-package))
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF