Browse Source

tor: always create folders and set ownership

Signed-off-by: Peter Wagner <tripolar@gmx.at>
lilik-openwrt-22.03
Peter Wagner 6 years ago
parent
commit
c6aa3d1fab
2 changed files with 10 additions and 14 deletions
  1. +1
    -1
      net/tor/Makefile
  2. +9
    -13
      net/tor/files/tor.init

+ 1
- 1
net/tor/Makefile View File

@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=tor PKG_NAME:=tor
PKG_VERSION:=0.3.5.8 PKG_VERSION:=0.3.5.8
PKG_RELEASE:=1
PKG_RELEASE:=2
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://dist.torproject.org/ \ PKG_SOURCE_URL:=https://dist.torproject.org/ \


+ 9
- 13
net/tor/files/tor.init View File

@ -7,19 +7,15 @@ STOP=50
USE_PROCD=1 USE_PROCD=1
start_service() { 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_open_instance
procd_set_param command /usr/sbin/tor --runasdaemon 0 procd_set_param command /usr/sbin/tor --runasdaemon 0
procd_close_instance procd_close_instance


Loading…
Cancel
Save