SOURCES: privoxy.sysconfig (NEW), privoxy.init - standarized, adde...

radek radek at pld-linux.org
Sun Nov 13 17:59:53 CET 2005


Author: radek                        Date: Sun Nov 13 16:59:53 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- standarized, added sysconfig support

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

---- Diffs:

================================================================
Index: SOURCES/privoxy.sysconfig
diff -u /dev/null SOURCES/privoxy.sysconfig:1.1
--- /dev/null	Sun Nov 13 17:59:53 2005
+++ SOURCES/privoxy.sysconfig	Sun Nov 13 17:59:48 2005
@@ -0,0 +1,8 @@
+# Customized settings for tor
+# $Id$
+
+PRIVOXY_USER="privoxy"
+PRIVOXY_GROUP="privoxy"
+PRIVOXY_CONFIG="/etc/privoxy/config"
+
+# vi:syntax=sh:ts=8:sw=4

================================================================
Index: SOURCES/privoxy.init
diff -u SOURCES/privoxy.init:1.1 SOURCES/privoxy.init:1.2
--- SOURCES/privoxy.init:1.1	Sun Oct 23 11:47:58 2005
+++ SOURCES/privoxy.init	Sun Nov 13 17:59:48 2005
@@ -5,12 +5,34 @@
 # chkconfig:	345 85 15
 # description:	Web proxy with advanced filtering capabilities
 # processname:	privoxy
-#
 # pidfile:	/var/run/privoxy.pid
+#
+# $Id$
 
 # Source function library.
 . /etc/rc.d/init.d/functions
 
+# Get network config
+. /etc/sysconfig/network
+
+# Set defaults
+PRIVOXY_USER="privoxy"
+PRIVOXY_GROUP="privoxy"
+PRIVOXY_CONFIG="/etc/privoxy/config"
+
+# Get service config - may override defaults
+[ -f /etc/sysconfig/privoxy ] && . /etc/sysconfig/privoxy
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+	if [ ! -f /var/lock/subsys/network ]; then
+		msg_network_down privoxy
+		exit 1
+	fi
+else
+	exit 0
+fi
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -19,9 +41,9 @@
 	if [ ! -f /var/lock/subsys/privoxy ]; then
 		msg_starting privoxy
 		daemon privoxy \
-		    --user privoxy.privoxy \
+		    --user $PRIVOXY_USER.$PRIVOXY_GROUP \
 		    --pidfile /var/run/privoxy.pid \
-		    /etc/privoxy/config
+		    $PRIVOXY_CONFIG
 		RETVAL=$?
 		[ $RETVAL -eq 0 ] && touch /var/lock/subsys/privoxy
 	else
@@ -41,7 +63,7 @@
   reload|force-reload)
 	if [ -f /var/lock/subsys/privoxy ]; then
 		msg_reloading privoxy
-		killproc privoxy -HUP
+		killproc --pidfile /var/run/privoxy.pid privoxy -HUP
 		RETVAL=$?
 	else
 		msg_not_running privoxy >&2
@@ -63,3 +85,6 @@
 esac
 
 exit $RETVAL
+
+# This must be last line !
+# vi:syntax=sh:ts=8:sw=4
================================================================

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




More information about the pld-cvs-commit mailing list