summaryrefslogtreecommitdiff
path: root/debian/tor.postinst
diff options
context:
space:
mode:
authorPeter Palfrader <peter@palfrader.org>2008-01-21 15:00:34 +0000
committerPeter Palfrader <peter@palfrader.org>2008-01-21 15:00:34 +0000
commit17d711e25803e996280080b48c7ce64fb832fa80 (patch)
tree13844cad3c7ce2fb8f340eff3d2c44c510b89e60 /debian/tor.postinst
parentd98d1ea0d9d0d8cb879aa5954bf4fedf4ae8d2a4 (diff)
downloadtor-17d711e25803e996280080b48c7ce64fb832fa80.tar.gz
tor-17d711e25803e996280080b48c7ce64fb832fa80.zip
postinst: if we reboot between unpacking and configuring on some smart systems
this will mean that we just lost /var/run/tor - creating it in the maintainer script if it doesn't exist. svn:r13208
Diffstat (limited to 'debian/tor.postinst')
-rw-r--r--debian/tor.postinst8
1 files changed, 8 insertions, 0 deletions
diff --git a/debian/tor.postinst b/debian/tor.postinst
index efc7e25143..70b14eec9a 100644
--- a/debian/tor.postinst
+++ b/debian/tor.postinst
@@ -31,6 +31,14 @@ else
fi
+for i in lib run log; do
+ if ! [ -d "/var/$i/tor" ]; then
+ echo "Something or somebody made /var/$i/tor disappear."
+ echo "Creating one for you again."
+ mkdir "/var/$i/tor"
+ fi
+done
+
find /var/lib/tor ! -user debian-tor -o ! -group debian-tor -print0 | xargs -0 --no-run-if-empty chown debian-tor:debian-tor
find /var/lib/tor -type d -print0 | xargs -0 --no-run-if-empty chmod 02700
find /var/lib/tor -type f -print0 | xargs -0 --no-run-if-empty chmod 00600