[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)
- To: or-cvs@xxxxxxxxxxxxx
- Subject: [or-cvs] r8298: Do not reload or start when our config is known to be broken (in tor/trunk: . debian)
- From: weasel@xxxxxxxx
- Date: Tue, 29 Aug 2006 16:43:53 -0400 (EDT)
- Delivered-to: archiver@seul.org
- Delivered-to: or-cvs-outgoing@seul.org
- Delivered-to: or-cvs@seul.org
- Delivery-date: Tue, 29 Aug 2006 16:44:02 -0400
- Reply-to: or-talk@xxxxxxxxxxxxx
- Sender: owner-or-cvs@xxxxxxxxxxxxx
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."