From c6aa3d1fabff6dbf54bb2d081662fa6d2263b1be Mon Sep 17 00:00:00 2001 From: Peter Wagner Date: Mon, 11 Mar 2019 19:58:14 +0100 Subject: [PATCH] tor: always create folders and set ownership Signed-off-by: Peter Wagner --- net/tor/Makefile | 2 +- net/tor/files/tor.init | 22 +++++++++------------- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/net/tor/Makefile b/net/tor/Makefile index 30eb0b3b5..41e7c8d63 100644 --- a/net/tor/Makefile +++ b/net/tor/Makefile @@ -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/ \ diff --git a/net/tor/files/tor.init b/net/tor/files/tor.init index 6974057d4..ee0818d9d 100644 --- a/net/tor/files/tor.init +++ b/net/tor/files/tor.init @@ -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