2015-09-29 14 views
0

我正在致力于一个需要加载两个实例(一个隐藏服务和一个中继)的tor服务器。 当我'使用一个情况下,它的正常工作......但我this tutorial对PID无法打开“/var/run/tor/tor0.pid”进行写入:多个实例后权限被拒绝

随着它的正常工作i'havent允许的任何问题,原来的守护进程权限问题...

但是,如果使用this one其补充一点:

# --- Multi-instance init --- 

config="/etc/tor" 
arrrgs="$ARGS" 
command=$1 
shift 
instances=$* 

instances() { 
    case $instances in 
     "") 
      for c in $config/*.cfg 
      do 
       base=${c##*/} 
       test -f "$c" && echo ${base%.cfg} 
      done 
      ;; 
     *) 
      echo "$instances" 
      ;; 
    esac 
} 

case "$command" in 
    start|stop|restart|reload|force-reload|status) 
     highest=0 
     for i in $(instances) 
     do 
      NAME=$i 
      DESC=$i 
      TORPID="$TORPIDDIR/$i.pid" 
      ARGS="$arrrgs -f $config/$i.cfg" 
      execute $command 
      status=$? 
      test $status -gt $highest && highest=$status 
     done 
     exit $highest 
     ;; 
    *) 
     execute 
     exit 1 
     ;; 
esac 

我在通知0/1.登录

16年9月29日误差:47 1:10.000 [提醒]无法打开“/ var/run中/符/ tor0.pid“写入:权限被拒绝

因此,我不能停止tor的实例...怎么可能?如何改正它?是什么关于第一守护进程(原来的)和新之间权限的差异...

非常感谢事先通过

编辑:

如果在配置我有PIDFILE/VAR /run/tor/tor.pid它的工作没有权限问题,但如果我有PidFile /var/run/tor/tor0.pid权限错误...什么?

+0

/变种/运行/ TOR的权限为:drwx - S - 2的debian-TOR的debian-TOR 80 09月29日17:24 TOR – Debroglie

+0

什么用户拥有每个PID的文件?也许tor0.pid被root或其他用户所拥有?要手动停止它,只需以root身份运行'kill -3 xxx',其中xxx是要停止的Tor进程的PID。然后以root身份删除它没有写入权限的PID文件。 – drew010

+0

目录中没有tor0.pid文件:(。谢谢 – Debroglie

回答

0

我只是把所有的PID文件/var/lib/tor/tor*.pid和它现在的工作...

PATH=/sbin:/bin:/usr/sbin:/usr/bin 
DAEMON=/usr/bin/tor 
NAME=tor 
DESC="tor daemon" 
TORLOGDIR=/var/log/tor 
TORPIDDIR=/var/lib/tor 
TORPID=$TORPIDDIR/tor.pid 
DEFAULTSFILE=/etc/default/$NAME 

而且在配置

## The directory for keeping all the keys/etc. By default, we store 
## things in $HOME/.tor on Unix, and in Application Data\tor on Windows. DataDirectory /var/lib/tor/0 
PidFile /var/lib/tor/tor0.pid 
Log notice file /var/log/tor/notices0.log 
修改

如果有人知道它为什么现在正在工作,那将会很棒。

感谢

相关问题