]>
Commit | Line | Data |
---|---|---|
bf7542bc | 1 | #!/bin/sh |
2 | # | |
b0300ebb | 3 | # codasrv |
bf7542bc | 4 | # |
5 | # chkconfig: 345 96 01 | |
6 | # | |
7 | # description: The Coda File Server | |
8 | # | |
9 | ||
10 | # Source function library | |
11 | . /etc/rc.d/init.d/functions | |
12 | ||
13 | # Get network config | |
14 | . /etc/sysconfig/network | |
15 | ||
16 | # Check that networking is up | |
fde3a400 | 17 | if is_yes "${NETWORKING}"; then |
21f06a93 | 18 | if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then |
fde3a400 | 19 | msg_network_down codasrv |
20 | exit 1 | |
21 | fi | |
22 | else | |
23 | exit 0 | |
bf7542bc | 24 | fi |
25 | ||
5a8a8a34 | 26 | RETVAL=0 |
bf7542bc | 27 | case "$1" in |
a61a406d | 28 | start) |
29 | # Check if the service is already running? | |
5a8a8a34 | 30 | if [ ! -f /var/lock/subsys/codasrv ]; then |
a61a406d | 31 | msg_starting codasrv |
32 | startserver >/dev/null 2>&1 & | |
a61a406d | 33 | RETVAL=$? |
5a8a8a34 | 34 | ok |
a61a406d | 35 | [ RETVAL -eq 0 ] && touch /var/lock/subsys/codasrv |
5a8a8a34 | 36 | else |
37 | msg_already_running codasrv | |
bf7542bc | 38 | fi |
a61a406d | 39 | ;; |
40 | stop) | |
41 | if [ -f /var/lock/subsys/codasrv ]; then | |
42 | msg_stopping codasrv | |
43 | busy | |
44 | volutil shutdown >/dev/null 2>&1 | |
45 | ok | |
46 | show "Waiting for Coda server shutdown" | |
47 | busy | |
48 | while [ -f /var/lib/vice/srv/pid ]; do | |
49 | sleep 1 | |
50 | done | |
a61a406d | 51 | ok |
52 | rm -f /var/lock/subsys/codasrv | |
bf7542bc | 53 | else |
a61a406d | 54 | msg_not_running codasrv |
bf7542bc | 55 | fi |
a61a406d | 56 | ;; |
57 | status) | |
58 | ;; | |
5a8a8a34 | 59 | restart|force-reload) |
a61a406d | 60 | $0 stop |
bf7542bc | 61 | $0 start |
5a8a8a34 | 62 | exit $? |
a61a406d | 63 | ;; |
64 | *) | |
5a8a8a34 | 65 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
66 | exit 3 | |
bf7542bc | 67 | ;; |
68 | esac | |
69 | ||
70 | exit $RETVAL |