Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > 2163989d24c3471833500e1276a1b15f > files > 1

distcache-client-1.5.1-17mdv2010.1.x86_64.rpm

#!/bin/bash
#
# dc_client	This shell script takes care of starting and stopping
#		the Distcache SSL Session Cache Client Proxy.
#
# chkconfig: 345 88 12
# description: Distcache is a Distributed SSL Session Cache Client Proxy.
# processname: dc_client
# pidfile: /var/run/dc_client.pid

### BEGIN INIT INFO
# Provides: dc_client
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 3 4 5
# Short-Description: A Distributed SSL Session Cache Client Proxy.
# Description: A Distributed SSL Session Cache Client Proxy.
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -f /usr/sbin/dc_client ] || exit 0

if [ -f /etc/sysconfig/distcache ]; then
        . /etc/sysconfig/distcache
fi

port=${PORT-5555}
socket=${SOCKET-/var/cache/httpd/mod_ssl/ssl_distcache}
server=${SERVER-localhost}:${port}
owner=${OWNER-apache}

prog=dc_client
RETVAL=0
runas=nobody
dc_client=/usr/sbin/dc_client
pidfile=/var/run/dc_client.pid

OPTIONS="-daemon -pidfile ${pidfile} -listen UNIX:${socket} \
         -sockowner ${owner} -sockperms 0600 -user ${runas} -server IP:${server}"

start() {
        gprintf "Starting %s: " "$prog"
        daemon $dc_client $OPTIONS
        RETVAL=$?
	echo
        [ $RETVAL = 0 ] && touch /var/lock/subsys/dc_client
        return $RETVAL
}
stop() {
	gprintf "Stopping %s: " "$prog"
	killproc $dc_client
	RETVAL=$?
	echo
	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/dc_client /var/run/dc_client.pid
}

# See how we were called.
case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  status)
        status $dc_client
	RETVAL=$?
	;;
  restart|reload)
	stop
	start
	;;
  condrestart)
	if [ -f /var/run/dc_client.pid ] ; then
		stop
		start
	fi
	;;
  *)
	gprintf "Usage: %s {start|stop|status|restart|condrestart|reload}\n" "$prog"
	exit 1
esac

exit $RETVAL