]> git.pld-linux.org Git - packages/coda.git/blob - coda.codasrv.init
- oops, bison, not yacc
[packages/coda.git] / coda.codasrv.init
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_yes "${NETWORKING}"; then
18         if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
19                 msg_network_down codasrv
20                 exit 1
21         fi
22 else
23         exit 0
24 fi
25
26 RETVAL=0
27 case "$1" in
28   start)
29         # Check if the service is already running?
30         if [ ! -f /var/lock/subsys/codasrv ]; then
31                 msg_starting codasrv
32                 startserver >/dev/null 2>&1 &
33                 RETVAL=$?
34                 ok
35                 [ RETVAL -eq 0 ] && touch /var/lock/subsys/codasrv
36         else
37                 msg_already_running codasrv
38         fi
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
51                 ok
52                 rm -f /var/lock/subsys/codasrv
53         else
54                 msg_not_running codasrv
55         fi
56         ;;
57   status)
58         ;;
59   restart|force-reload)
60         $0 stop
61         $0 start
62         exit $?
63         ;;
64   *)
65         msg_usage "$0 {start|stop|restart|force-reload|status}"
66         exit 3
67         ;;
68 esac
69
70 exit $RETVAL
This page took 0.033802 seconds and 3 git commands to generate.