diff options
author | Peter Palfrader <peter@palfrader.org> | 2007-10-21 22:12:24 +0000 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2007-10-21 22:12:24 +0000 |
commit | bacbf984cad5acd758c29eb2186005e3fefa0295 (patch) | |
tree | 577e105dea98add5fa406e0a16281115b08636d6 /debian | |
parent | 4a8cf7b51706ddfed164687e32450baab497f2ca (diff) | |
download | tor-bacbf984cad5acd758c29eb2186005e3fefa0295.tar tor-bacbf984cad5acd758c29eb2186005e3fefa0295.tar.gz |
Only create pid dir if we are about to start Tor (Luca Capello, closes: #447508)
svn:r12085
Diffstat (limited to 'debian')
-rw-r--r-- | debian/changelog | 7 | ||||
-rw-r--r-- | debian/tor.init | 22 |
2 files changed, 20 insertions, 9 deletions
diff --git a/debian/changelog b/debian/changelog index 6d3ff261a..7745d2599 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +tor (0.2.0.8-alpha-1+svn) experimentalX; urgency=low + + * Only create pid dir if we are about to start Tor (Luca Capello, + closes: #447508). + + -- Peter Palfrader <weasel@debian.org> Mon, 22 Oct 2007 00:11:15 +0200 + tor (0.2.0.8-alpha-1) experimental; urgency=low * New upstream version. diff --git a/debian/tor.init b/debian/tor.init index e4a931066..8333ff5da 100644 --- a/debian/tor.init +++ b/debian/tor.init @@ -61,16 +61,18 @@ wait_for_deaddaemon () { } -if test ! -d $TORPIDDIR; then - echo "There is no $TORPIDDIR directory. Creating one for you." - mkdir -m 02700 "$TORPIDDIR" - chown debian-tor:debian-tor "$TORPIDDIR" -fi +check_torpiddir () { + if test ! -d $TORPIDDIR; then + echo "There is no $TORPIDDIR directory. Creating one for you." + mkdir -m 02700 "$TORPIDDIR" + chown debian-tor:debian-tor "$TORPIDDIR" + fi -if test ! -x $TORPIDDIR; then - echo "Cannot access $TORPIDDIR directory, are you root?" >&2 - exit 1 -fi + if test ! -x $TORPIDDIR; then + echo "Cannot access $TORPIDDIR directory, are you root?" >&2 + exit 1 + fi +} case "$1" in @@ -89,6 +91,8 @@ case "$1" in fi fi + check_torpiddir + echo "Starting $DESC: $NAME..." if ! su -s /bin/sh -c "$DAEMON --verify-config" debian-tor > /dev/null; then echo "ABORTED: Tor configuration invalid:" >&2 |