[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r8298: Do not reload or start when our config is known to be broken (in tor/trunk: . debian)



Author: weasel
Date: 2006-08-29 16:43:52 -0400 (Tue, 29 Aug 2006)
New Revision: 8298

Modified:
   tor/trunk/
   tor/trunk/debian/tor.init
Log:
 r9565@galaxy:  weasel | 2006-08-29 22:20:38 +0200
 Do not reload or start when our config is known to be broken



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /local/or/tor/trunk [r9565] on 1f724f9b-111a-0410-b636-93f1a77c1813

Modified: tor/trunk/debian/tor.init
===================================================================
--- tor/trunk/debian/tor.init	2006-08-29 14:38:39 UTC (rev 8297)
+++ tor/trunk/debian/tor.init	2006-08-29 20:43:52 UTC (rev 8298)
@@ -81,12 +81,18 @@
 				fi
 			fi
 			echo "Starting $DESC: $NAME..."
-			start-stop-daemon --start --quiet --oknodo \
-				--chuid debian-tor:debian-tor \
-				--pidfile $TORPID \
-				$NICE \
-				--exec $DAEMON -- $ARGS
-			echo "done."
+			if ! su -c "$DAEMON --verify-config" debian-tor > /dev/null; then
+				echo "ABORTED: Tor configuration invalid:" >&2
+				su -c "$DAEMON --verify-config" debian-tor >&2
+				exit 1
+			else
+				start-stop-daemon --start --quiet --oknodo \
+					--chuid debian-tor:debian-tor \
+					--pidfile $TORPID \
+					$NICE \
+					--exec $DAEMON -- $ARGS
+				echo "done."
+			fi
 		fi
 	fi
 	;;
@@ -117,6 +123,10 @@
 	elif test ! -f $TORPID -o -z "$pid"
 	then
 		echo "not running (there is no $TORPID)."
+	elif ! su -c "$DAEMON --verify-config" debian-tor > /dev/null; then
+		echo "ABORTED: Tor configuration invalid:" >&2
+		su -c "$DAEMON --verify-config" debian-tor >&2
+		exit 1
 	elif start-stop-daemon --stop --signal 1 --quiet --pidfile $TORPID --exec $DAEMON
 	then
 		echo "$NAME."