]>
Commit | Line | Data |
---|---|---|
ff223964 AM |
1 | #!/bin/sh |
2 | # | |
c2560fc8 | 3 | # boa Boa Web Server |
ff223964 | 4 | # |
c2560fc8 | 5 | # chkconfig: 345 85 15 |
6 | # description: Boa is a World Wide Web server. It is used to serve \ | |
7 | # HTML files and CGI. | |
8 | # processname: boa | |
3a7898ee | 9 | # config: /etc/boa.conf |
ff223964 | 10 | |
c2560fc8 | 11 | |
12 | # Source function library | |
ff223964 AM |
13 | . /etc/rc.d/init.d/functions |
14 | ||
c2560fc8 | 15 | # Get network config |
16 | . /etc/sysconfig/network | |
17 | ||
18 | # Get service config - may override defaults | |
19 | [ -f /etc/sysconfig/boa ] && . /etc/sysconfig/boa | |
20 | ||
ff223964 | 21 | # Check that networking is up. |
2b364c77 | 22 | if is_yes "${NETWORKING}"; then |
ef35a52e | 23 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
2b364c77 | 24 | msg_network_down "Boa httpd" |
25 | exit 1 | |
26 | fi | |
27 | else | |
28 | exit 0 | |
c2560fc8 | 29 | fi |
ff223964 | 30 | |
bcc0ed90 | 31 | RETVAL=0 |
ff223964 AM |
32 | # See how we were called. |
33 | case "$1" in | |
34 | start) | |
c2560fc8 | 35 | # Check if the service is already running? |
36 | if [ ! -f /var/lock/subsys/boa ]; then | |
37 | msg_starting "Boa httpd" | |
38 | daemon boa | |
39 | RETVAL=$? | |
40 | [ $RETVAL -eq 0 ] && touch /var/lock/subsys/boa | |
41 | else | |
75edb694 | 42 | msg_already_running "Boa httpd" |
c2560fc8 | 43 | fi |
2b364c77 | 44 | ;; |
ff223964 | 45 | stop) |
2b364c77 | 46 | # Stop daemons. |
c2560fc8 | 47 | if [ -f /var/lock/subsys/boa ]; then |
48 | msg_stopping "Boa httpd" | |
49 | killproc boa | |
50 | rm -f /var/lock/subsys/boa >/dev/null 2>&1 | |
51 | else | |
75edb694 | 52 | msg_not_running "Boa httpd" |
c2560fc8 | 53 | fi |
2b364c77 | 54 | ;; |
ff223964 | 55 | restart) |
2b364c77 | 56 | $0 stop |
ff223964 | 57 | $0 start |
bcc0ed90 | 58 | exit $? |
2b364c77 | 59 | ;; |
bcc0ed90 | 60 | reload|force-reload) |
c2560fc8 | 61 | if [ -f /var/lock/subsys/boa ]; then |
f2dd6e97 | 62 | msg_reloading "Boa httpd" |
c2560fc8 | 63 | killproc boa -HUP |
bcc0ed90 | 64 | RETVAL=$? |
c2560fc8 | 65 | else |
bcc0ed90 | 66 | msg_not_running "Boa httpd" >&2 |
67 | exit 7 | |
c2560fc8 | 68 | fi |
ff223964 | 69 | ;; |
c2560fc8 | 70 | status) |
71 | status boa | |
72 | exit $? | |
2b364c77 | 73 | ;; |
c2560fc8 | 74 | *) |
f2b436e3 | 75 | msg_usage "$0 {start|stop|restart|reload|force-reload|status}" |
bcc0ed90 | 76 | exit 3 |
ff223964 AM |
77 | esac |
78 | ||
c2560fc8 | 79 | exit $RETVAL |