tor: always create folders and set ownership
authorPeter Wagner <tripolar@gmx.at>
Mon, 11 Mar 2019 18:58:14 +0000 (19:58 +0100)
committerPeter Wagner <tripolar@gmx.at>
Mon, 11 Mar 2019 18:58:44 +0000 (19:58 +0100)
Signed-off-by: Peter Wagner <tripolar@gmx.at>
net/tor/Makefile
net/tor/files/tor.init

index 30eb0b3b5a213ca639da8d4f3d4431cbb9c937ff..41e7c8d6357c26aaf05df28761475ea9d7c14811 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=tor
 PKG_VERSION:=0.3.5.8
-PKG_RELEASE:=1
+PKG_RELEASE:=2
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=https://dist.torproject.org/ \
index 6974057d45d83e6901502fb5ec9e064b96a86501..ee0818d9d13afce182f8290b6aeb690d1164ed10 100644 (file)
@@ -7,19 +7,15 @@ STOP=50
 USE_PROCD=1
 
 start_service() {
-       [ -f /var/run/tor.pid ] || {
-               touch /var/run/tor.pid
-               chown tor:tor /var/run/tor.pid
-       }
-       [ -d /var/lib/tor ] || {
-               mkdir -m 0755 -p /var/lib/tor
-               chmod 0700 /var/lib/tor
-               chown tor:tor /var/lib/tor
-       }
-       [ -d /var/log/tor ] || {
-               mkdir -m 0755 -p /var/log/tor
-               chown tor:tor /var/log/tor
-       }
+       touch /var/run/tor.pid
+       chown tor:tor /var/run/tor.pid
+
+       mkdir -m 0700 -p /var/lib/tor
+       chown -R tor:tor /var/lib/tor
+
+       mkdir -m 0755 -p /var/log/tor
+       chown -R tor:tor /var/log/tor
+
        procd_open_instance
        procd_set_param command /usr/sbin/tor --runasdaemon 0
        procd_close_instance