From: Fabian Keil <fk@fabiankeil.de>
Date: Sat, 18 Nov 2006 14:06:14 +0000 (+0000)
Subject: Added warning that this script isn't supposed
X-Git-Tag: v_3_0_6~3
X-Git-Url: http://www.privoxy.org/gitweb/@default-cgi@/faq/%22https:/user-manual/diff?a=commitdiff_plain;h=60f82e785de02b0322f3e52c5b87e43f7edc9473;p=privoxy.git

Added warning that this script isn't supposed
to be sourced in other rc scripts. Should prevent
bug reports like #1542947.

Changed command line order to make sure
the config file is the last argument.
Thanks to William for reporting this.
---

diff --git a/slackware/rc.privoxy.orig b/slackware/rc.privoxy.orig
index 632a6b78..4c734fff 100644
--- a/slackware/rc.privoxy.orig
+++ b/slackware/rc.privoxy.orig
@@ -1,5 +1,9 @@
 #!/bin/sh
 #  ********************************************************************
+#  This script uses exit to return proper error codes,
+#  sourcing (. /path/to/rc.privoxy) it in your system's
+#  rc files is a bad idea.
+#  ********************************************************************
 
 RETVAL=1
 
@@ -19,14 +23,14 @@ if [ ! -f $PRIVOXY_CONF ] ; then exit 0 ;fi
 
 # See how we were called.
 
-PRIVOXY="$PRIVOXY_BIN $PRIVOXY_CONF"
+PRIVOXY="$PRIVOXY_BIN --user $PRIVOXY_USER.$PRIVOXY_GROUP --pidfile $PRIVOXY_PID $PRIVOXY_CONF"
 
 start () {
 	# start daemon
 	echo -n $"Starting $PRIVOXY_PRG: "
 
 	if [ ! -f $PRIVOXY_PID ]; then
-		($PRIVOXY --user $PRIVOXY_USER.$PRIVOXY_GROUP  --pidfile $PRIVOXY_PID 2>/dev/tty9 ) \
+		( $PRIVOXY 2>/dev/tty9 ) \
 			&& echo " OK" \
 			&& /bin/touch /var/lock/$PRIVOXY_PRG \
 			&& RETVAL=0