diff options
author | Peter Palfrader <peter@palfrader.org> | 2006-08-29 20:43:52 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2006-08-29 20:43:52 +0000 |
commit | e866702809d7c1bd9e3b445e1445cbb1b315b093 (patch) | |
tree | 5fb0c8076d216cfdf538dc9a30ccc8c8aaed883c | |
parent | 4fa8abb7da9ec6220d9440f0d4136a963d776920 (diff) | |
download | tor-e866702809d7c1bd9e3b445e1445cbb1b315b093.tar tor-e866702809d7c1bd9e3b445e1445cbb1b315b093.tar.gz |
r9565@galaxy: weasel | 2006-08-29 22:20:38 +0200
Do not reload or start when our config is known to be broken
svn:r8298
-rw-r--r-- | debian/tor.init | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/debian/tor.init b/debian/tor.init index e930b496f..1921f0704 100644 --- a/debian/tor.init +++ b/debian/tor.init @@ -81,12 +81,18 @@ case "$1" in 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 @@ case "$1" in 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." |