SOURCES: dc_client.sysconfig (NEW), dc_client.init - pldized

glen glen at pld-linux.org
Wed Dec 14 13:59:25 CET 2005


Author: glen                         Date: Wed Dec 14 12:59:25 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- pldized

---- Files affected:
SOURCES:
   dc_client.sysconfig (NONE -> 1.1)  (NEW), dc_client.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/dc_client.sysconfig
diff -u /dev/null SOURCES/dc_client.sysconfig:1.1
--- /dev/null	Wed Dec 14 13:59:25 2005
+++ SOURCES/dc_client.sysconfig	Wed Dec 14 13:59:20 2005
@@ -0,0 +1,10 @@
+# $Id$
+# Customized settings for dc_client
+
+#PORT=5555
+
+#SOCKET=/var/cache/mod_ssl/distcache
+
+#SERVER=localhost:${PORT}
+
+#OWNER=http

================================================================
Index: SOURCES/dc_client.init
diff -u SOURCES/dc_client.init:1.1 SOURCES/dc_client.init:1.2
--- SOURCES/dc_client.init:1.1	Wed Dec 14 13:33:54 2005
+++ SOURCES/dc_client.init	Wed Dec 14 13:59:20 2005
@@ -2,77 +2,84 @@
 #
 # distcache    Startup script for the Distcache SSL Session Cache Client Proxy
 #
-# chkconfig: - 88 12
-# description: Distcache is a Distributed SSL Session Cache Client Proxy.
-# processname: dc_client
-# config: /etc/sysconfig/distcache
-# pidfile: /var/run/dc_client.pid
+# chkconfig:	345 88 12
+# description:	Distcache is a Distributed SSL Session Cache Client Proxy.
+# processname:	dc_client
+# config:		/etc/sysconfig/distcache
+# pidfile:		/var/run/dc_client.pid
+#
+# $Id$
 
 # Source function library.
 . /etc/rc.d/init.d/functions
 
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network ]; then
+		msg_network_down dc_client
+		exit 1
+	fi
+else
+	exit 0
+fi
+
+# Get service config
 if [ -f /etc/sysconfig/distcache ]; then
-        . /etc/sysconfig/distcache
+	. /etc/sysconfig/distcache
 fi
 
 port=${PORT-5555}
 socket=${SOCKET-/var/cache/mod_ssl/distcache}
 server=${SERVER-localhost}:${port}
-owner=${OWNER-apache}
+owner=${OWNER-http}
 
-prog=dc_client
-RETVAL=0
 runas=nobody
 dc_client=/usr/bin/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() {
-        echo -n $"Starting $prog: "
-        daemon $dc_client $OPTIONS
-        RETVAL=$?
-        echo
-        [ $RETVAL = 0 ] && touch /var/lock/subsys/dc_client
-        return $RETVAL
-}
-stop() {
-	echo -n $"Stopping $prog: "
-	killproc $dc_client
-	RETVAL=$?
-	echo
-	[ $RETVAL = 0 ] && rm -f /var/lock/subsys/dc_client /var/run/dc_client.pid
-}
+	-sockowner ${owner} -sockperms 0600 -user ${runas} -server IP:${server}"
 
 # See how we were called.
 case "$1" in
-  start)
-	start
-	;;
-  stop)
-	stop
-	;;
-  status)
-        status $dc_client
-	RETVAL=$?
-	;;
-  restart)
-	stop
-	start
+start)
+	# Check if the service is already running?
+	if [ ! -f /var/lock/subsys/dc_client ]; then
+		msg_starting dc_client
+		daemon $dc_client $OPTIONS
+		RETVAL=$?
+		[ $RETVAL = 0 ] && touch /var/lock/subsys/dc_client
+	else
+		msg_already_running dc_client
+	fi
 	;;
-  condrestart)
-	if [ -f /var/run/dc_client.pid ] ; then
-		stop
-		start
+stop)
+	if [ -f /var/lock/subsys/dc_client ]; then
+		# Stop daemons.
+		msg_stopping dc_client
+		killproc $dc_client
+		rm -f /var/lock/subsys/dc_client /var/run/dc_client.pid
+	else
+		msg_not_running dc_client
 	fi
 	;;
-  reload)
-        reload
+status)
+	status $dc_client
+	RETVAL=$?
 	;;
-  *)
-	echo $"Usage: $prog {start|stop|restart|condrestart|status|help}"
-	exit 1
+restart|reload|force-reload)
+	$0 stop
+	$0 start
+	;;
+*)
+	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+	exit 3
 esac
 
 exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:tw=78:ts=4:sw=4
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/dc_client.init?r1=1.1&r2=1.2&f=u




More information about the pld-cvs-commit mailing list