diff options
Diffstat (limited to 'meta-webserver/recipes-httpd/apache2/files/init')
-rwxr-xr-x | meta-webserver/recipes-httpd/apache2/files/init | 73 |
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 | |||
12 | ARGS="-D SSL -D PHP5 -k start" | ||
13 | NAME=apache2 | ||
14 | PATH=/bin:/usr/bin:/sbin:/usr/sbin | ||
15 | DAEMON=/usr/sbin/httpd | ||
16 | SUEXEC=/usr/lib/apache/suexec | ||
17 | PIDFILE=/run/httpd.pid | ||
18 | CONF=/etc/apache2/httpd.conf | ||
19 | APACHECTL=/usr/sbin/apachectl | ||
20 | |||
21 | trap "" 1 | ||
22 | export LANG=C | ||
23 | export PATH | ||
24 | |||
25 | test -f $DAEMON || exit 0 | ||
26 | test -f $APACHECTL || exit 0 | ||
27 | |||
28 | # ensure we don't leak environment vars into apachectl | ||
29 | APACHECTL="env -i LANG=${LANG} PATH=${PATH} $APACHECTL" | ||
30 | |||
31 | case "$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 | ;; | ||
65 | esac | ||
66 | |||
67 | if [ $? = 0 ]; then | ||
68 | echo . | ||
69 | exit 0 | ||
70 | else | ||
71 | echo failed | ||
72 | exit 1 | ||
73 | fi | ||