]>
Commit | Line | Data |
---|---|---|
bf7542bc | 1 | #!/bin/sh |
2 | # | |
3 | # update | |
4 | # | |
5 | # chkconfig: 345 95 02 | |
6 | # | |
7 | # description: The Coda update server and clients | |
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 |
18 | if [ ! -f /var/lock/subsys/network ]; then | |
19 | msg_network_down update | |
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/update ]; then |
a61a406d | 31 | msg_starting rpc2portmap |
32 | daemon rpc2portmap | |
5a8a8a34 | 33 | RETVAL=$? |
a61a406d | 34 | msg_starting updatesrv |
35 | daemon updatesrv | |
5a8a8a34 | 36 | [ RETVAL -eq 0 ] && RETVAL=$? |
a61a406d | 37 | msg_starting updateclnt |
38 | daemon updateclnt -h `cat /var/lib/vice/db/scm` | |
5a8a8a34 | 39 | [ RETVAL -eq 0 ] && RETVAL=$? |
a61a406d | 40 | [ RETVAL -eq 0 ] && touch /var/lock/subsys/update |
5a8a8a34 | 41 | else |
42 | msg_already_running update | |
bf7542bc | 43 | fi |
a61a406d | 44 | ;; |
45 | stop) | |
46 | if [ -f /var/lock/subsys/update ]; then | |
47 | msg_stopping updateclnt | |
48 | killproc updateclnt | |
49 | msg_stopping updatesrv | |
50 | killproc updatesrv | |
51 | msg_stopping rpc2portmap | |
52 | killproc rpc2portmap | |
53 | rm -f /var/lock/subsys/update | |
bf7542bc | 54 | else |
a61a406d | 55 | msg_not_running update |
bf7542bc | 56 | fi |
a61a406d | 57 | ;; |
58 | status) | |
59 | ;; | |
5a8a8a34 | 60 | restart|force-reload) |
a61a406d | 61 | $0 stop |
bf7542bc | 62 | $0 start |
5a8a8a34 | 63 | exit $? |
a61a406d | 64 | ;; |
65 | *) | |
5a8a8a34 | 66 | msg_usage "$0 {start|stop|restart|force-reload|status}" |
67 | exit 3 | |
bf7542bc | 68 | ;; |
69 | esac | |
70 | ||
71 | exit $RETVAL |