summaryrefslogtreecommitdiff
path: root/debian/tor.init
diff options
context:
space:
mode:
Diffstat (limited to 'debian/tor.init')
-rw-r--r--debian/tor.init8
1 files changed, 6 insertions, 2 deletions
diff --git a/debian/tor.init b/debian/tor.init
index e0e4709f25..d764fb9423 100644
--- a/debian/tor.init
+++ b/debian/tor.init
@@ -65,8 +65,12 @@ case "$1" in
if [ "$RUN_DAEMON" != "yes" ]; then
echo "Not starting $DESC (Disabled in $DEFAULTSFILE)."
else
- if test ! -d $TORPIDDIR; then echo "There is no $TORPIDDIR directory." >&2; exit 1
- elif test ! -x $TORPIDDIR; then echo "Cannot access $TORPIDDIR directory, are you root?" >&2; exit 1;
+ 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;
else
echo "Starting $DESC: $NAME..."
ulimit -n $MAX_FILEDESCRIPTORS || echo "Warn: Could not set ulimit for number of file descriptors." >&2