summaryrefslogtreecommitdiffstats
path: root/meta-webserver/recipes-httpd/apache2/files/init
diff options
context:
space:
mode:
Diffstat (limited to 'meta-webserver/recipes-httpd/apache2/files/init')
-rwxr-xr-xmeta-webserver/recipes-httpd/apache2/files/init73
1 files changed, 73 insertions, 0 deletions
diff --git a/meta-webserver/recipes-httpd/apache2/files/init b/meta-webserver/recipes-httpd/apache2/files/init
new file mode 100755
index 000000000..a1adbd74f
--- /dev/null
+++ b/meta-webserver/recipes-httpd/apache2/files/init
@@ -0,0 +1,73 @@
1#!/bin/sh
2### BEGIN INIT INFO
3# Provides: httpd
4# Required-Start: $local_fs $remote_fs $network $named
5# Required-Stop: $local_fs $remote_fs $network
6# Should-Start: distcache
7# Short-Description: start and stop Apache HTTP Server
8# Description: The Apache HTTP Server is an extensible server
9# implementing the current HTTP standards.
10### END INIT INFO
11
12ARGS="-D SSL -D PHP5 -k start"
13NAME=apache2
14PATH=/bin:/usr/bin:/sbin:/usr/sbin
15DAEMON=/usr/sbin/httpd
16SUEXEC=/usr/lib/apache/suexec
17PIDFILE=/run/httpd.pid
18CONF=/etc/apache2/httpd.conf
19APACHECTL=/usr/sbin/apachectl
20
21trap "" 1
22export LANG=C
23export PATH
24
25test -f $DAEMON || exit 0
26test -f $APACHECTL || exit 0
27
28# ensure we don't leak environment vars into apachectl
29APACHECTL="env -i LANG=${LANG} PATH=${PATH} $APACHECTL"
30
31case "$1" in
32 start)
33 echo -n "Starting web server: $NAME"
34 $APACHECTL $ARGS
35 ;;
36
37 stop)
38 $APACHECTL stop
39 ;;
40
41 reload)
42 echo -n "Reloading $NAME configuration"
43 kill -HUP `cat $PIDFILE`
44 ;;
45
46 reload-modules)
47 echo -n "Reloading $NAME modules"
48 $APACHECTL restart
49 ;;
50
51 restart)
52 $APACHECTL restart
53 exit $?
54 ;;
55
56 force-reload)
57 $0 reload-modules
58 exit $?
59 ;;
60
61 *)
62 echo "Usage: /etc/init.d/$NAME {start|stop|reload|reload-modules|force-reload|restart}"
63 exit 1
64 ;;
65esac
66
67if [ $? = 0 ]; then
68 echo .
69 exit 0
70else
71 echo failed
72 exit 1
73fi