]> git.pld-linux.org Git - packages/distcache.git/blame - dc_client.init
- tabs in preamble
[packages/distcache.git] / dc_client.init
CommitLineData
0c75e2ca 1#!/bin/sh
831c28fd
ER
2#
3# distcache Startup script for the Distcache SSL Session Cache Client Proxy
4#
a6b06a07
ER
5# chkconfig: 345 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# $Id$
831c28fd
ER
12
13# Source function library.
14. /etc/rc.d/init.d/functions
15
a6b06a07
ER
16# Get network config
17. /etc/sysconfig/network
18
19# Check that networking is up.
20if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network ]; then
22 msg_network_down dc_client
23 exit 1
24 fi
25else
26 exit 0
27fi
28
29# Get service config
831c28fd 30if [ -f /etc/sysconfig/distcache ]; then
a6b06a07 31 . /etc/sysconfig/distcache
831c28fd
ER
32fi
33
34port=${PORT-5555}
35socket=${SOCKET-/var/cache/mod_ssl/distcache}
36server=${SERVER-localhost}:${port}
a6b06a07 37owner=${OWNER-http}
831c28fd 38
831c28fd
ER
39runas=nobody
40dc_client=/usr/bin/dc_client
41pidfile=/var/run/dc_client.pid
42
43OPTIONS="-daemon -pidfile ${pidfile} -listen UNIX:${socket} \
a6b06a07 44 -sockowner ${owner} -sockperms 0600 -user ${runas} -server IP:${server}"
831c28fd
ER
45
46# See how we were called.
47case "$1" in
a6b06a07
ER
48start)
49 # Check if the service is already running?
50 if [ ! -f /var/lock/subsys/dc_client ]; then
51 msg_starting dc_client
52 daemon $dc_client $OPTIONS
53 RETVAL=$?
54 [ $RETVAL = 0 ] && touch /var/lock/subsys/dc_client
55 else
56 msg_already_running dc_client
57 fi
831c28fd 58 ;;
a6b06a07
ER
59stop)
60 if [ -f /var/lock/subsys/dc_client ]; then
61 # Stop daemons.
62 msg_stopping dc_client
63 killproc $dc_client
64 rm -f /var/lock/subsys/dc_client /var/run/dc_client.pid
65 else
66 msg_not_running dc_client
67 fi
831c28fd 68 ;;
a6b06a07
ER
69status)
70 status $dc_client
831c28fd
ER
71 RETVAL=$?
72 ;;
a6b06a07
ER
73restart|reload|force-reload)
74 $0 stop
75 $0 start
831c28fd 76 ;;
a6b06a07
ER
77*)
78 msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
79 exit 3
831c28fd
ER
80esac
81
82exit $RETVAL
a6b06a07
ER
83
84# This must be last line !
85# vi:syntax=sh:tw=78:ts=4:sw=4
This page took 0.071167 seconds and 4 git commands to generate.