]>
Commit | Line | Data |
---|---|---|
bf7542bc | 1 | #!/bin/sh |
2 | # | |
3 | # codasrv | |
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 | |
17 | if is_no "${NETWORKING}"; then | |
18 | msg_network_down codasrv | |
19 | exit 1 | |
20 | fi | |
21 | ||
22 | case "$1" in | |
23 | start) | |
24 | # Check if the service is already running? | |
25 | if [ -f /var/lock/subsys/codasrv ]; then | |
26 | msg_already_running codasrv | |
27 | else | |
28 | msg_starting codasrv | |
29 | startserver & | |
30 | RETVAL=$? | |
31 | [ RETVAL -eq 0 ] && touch /var/lock/subsys/codasrv | |
32 | fi | |
33 | ;; | |
34 | stop) | |
35 | if [ -f /var/lock/subsys/codasrv ]; then | |
36 | msg_stopping codasrv | |
37 | volutil shutdown | |
38 | sleep 30 | |
39 | rm -f /var/lock/subsys/codasrv | |
40 | else | |
41 | msg_Not_Running codasrv | |
42 | fi | |
43 | ;; | |
44 | restart) | |
45 | $0 stop | |
46 | $0 start | |
47 | ;; | |
48 | *) | |
49 | msg_usage "$0 {start|stop|restart}" | |
50 | exit 1 | |
51 | ;; | |
52 | esac | |
53 | ||
54 | exit $RETVAL | |
55 |