]> git.pld-linux.org Git - packages/distcache.git/blob - dc_client.init
- from centos src.rpm
[packages/distcache.git] / dc_client.init
1 #!/bin/bash
2 #
3 # distcache    Startup script for the Distcache SSL Session Cache Client Proxy
4 #
5 # chkconfig: - 88 12
6 # description: Distcache is a Distributed SSL Session Cache Client Proxy.
7 # processname: dc_client
8 # config: /etc/sysconfig/distcache
9 # pidfile: /var/run/dc_client.pid
10
11 # Source function library.
12 . /etc/rc.d/init.d/functions
13
14 if [ -f /etc/sysconfig/distcache ]; then
15         . /etc/sysconfig/distcache
16 fi
17
18 port=${PORT-5555}
19 socket=${SOCKET-/var/cache/mod_ssl/distcache}
20 server=${SERVER-localhost}:${port}
21 owner=${OWNER-apache}
22
23 prog=dc_client
24 RETVAL=0
25 runas=nobody
26 dc_client=/usr/bin/dc_client
27 pidfile=/var/run/dc_client.pid
28
29 OPTIONS="-daemon -pidfile ${pidfile} -listen UNIX:${socket} \
30          -sockowner ${owner} -sockperms 0600 -user ${runas} -server IP:${server}"
31
32 start() {
33         echo -n $"Starting $prog: "
34         daemon $dc_client $OPTIONS
35         RETVAL=$?
36         echo
37         [ $RETVAL = 0 ] && touch /var/lock/subsys/dc_client
38         return $RETVAL
39 }
40 stop() {
41         echo -n $"Stopping $prog: "
42         killproc $dc_client
43         RETVAL=$?
44         echo
45         [ $RETVAL = 0 ] && rm -f /var/lock/subsys/dc_client /var/run/dc_client.pid
46 }
47
48 # See how we were called.
49 case "$1" in
50   start)
51         start
52         ;;
53   stop)
54         stop
55         ;;
56   status)
57         status $dc_client
58         RETVAL=$?
59         ;;
60   restart)
61         stop
62         start
63         ;;
64   condrestart)
65         if [ -f /var/run/dc_client.pid ] ; then
66                 stop
67                 start
68         fi
69         ;;
70   reload)
71         reload
72         ;;
73   *)
74         echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
75         exit 1
76 esac
77
78 exit $RETVAL
This page took 0.030085 seconds and 4 git commands to generate.