updated on Tue Jan 10 00:10:07 UTC 2012
[aur-mirror.git] / coda / venus
blob97410a8a1e44fe1a96b1bc59984c2c6624a5c3ad
1 #!/bin/sh
3 # skeleton Example file to build /etc/init.d scripts.
5 # Version: @(#) /etc/init.d/skeleton 1.01 26-Oct-1993
7 # Author: Miquel van Smoorenburg, <miquels@drinkel.nl.mugnet.org>
10 # chkconfig: 345 97 01
11 # description: The Coda cache manager.
13 prefix=/usr
14 exec_prefix=${prefix}
16 PATH=/sbin:/usr/sbin:/usr/local/sbin:$PATH
17 export PATH
19 # defaults
20 pid_file=/usr/coda/venus.cache/pid
21 mountpoint=/coda
23 # overridden from the venus.conf
24 [ -f ${exec_prefix}/sbin/codaconfedit ] && . `${exec_prefix}/sbin/codaconfedit venus.conf`
26 [ -f ${exec_prefix}/sbin/venus ] || exit 0
28 echon() {
29 if [ "`echo -n`" ] ; then
30 echo "$@"\c
31 else
32 echo -n "$@"
37 # See how we were called.
38 case "$1" in
39 start)
40 echon "Starting Coda client components:"
41 if [ -f $pid_file ]; then
42 echo "$pid_file exists, venus already running?."
44 [ -d /var/lock/subsys ] && touch /var/lock/subsys/venus.init
46 echon " kernel"
47 /sbin/modprobe coda
48 [ -x /sbin/udevsettle ] && /sbin/udevsettle || sleep 5
50 ${exec_prefix}/sbin/vutil --swaplogs
51 echon " venus"
52 ${exec_prefix}/sbin/venus > /dev/null 2>&1
53 echo " done."
55 stop)
56 echon "Shutting down venus: "
57 if [ -f $pid_file ]; then
58 kill -TERM `cat $pid_file`
59 umount $mountpoint
61 rm -f $pid_file
62 [ -d /var/lock/subsys ] && rm -f /var/lock/subsys/venus.init
63 echo "done."
65 hardstop)
66 echon "Killing venus: "
67 if [ -f $pid_file ]; then
68 kill -9 `cat $pid_file`
69 umount $mountpoint
71 rm -f $pid_file
72 echo "done."
74 restart|force-reload)
75 echo "$1 not available"
78 echo "Usage: $0 {start|stop|hardstop}"
79 exit 1
81 esac
83 exit 0