View previous topic :: View next topic |
Author |
Message |
SarahS93 l33t
Joined: 21 Nov 2013 Posts: 693
|
Posted: Wed Jan 03, 2018 3:44 pm Post subject: tor can not create pid file |
|
|
If i run tor, it shows me an error that its not possible to create a pid file at /var/run
the problem is "drwxr-xr-x 1 root root 122 1. Nov 00:26 var", no "w" for others.
should i set it myself for write for others or is this an bad idea?
tor runs, thats not the problem, but i will have the pid in a file.
i can change the path to the pid file by the torrc file.
what way shoul i chose? |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jan 03, 2018 4:54 pm Post subject: |
|
|
SarahS93 ...
Firstly, /var/run is a symbolic link to /run ... the init script should create the required directory structure with the required permissions:
/etc/init.d/tor: | start_pre() {
checkconfig || return 1
checkpath -d -m 0755 -o tor:tor /var/run/tor
} |
Sounds as though you may have changed 'PIDFile' to /run, if so then set the following:
/etc/tor/torrc: | PIDFile /run/tor/tor.pid |
HTH & best ... khay |
|
Back to top |
|
|
SarahS93 l33t
Joined: 21 Nov 2013 Posts: 693
|
Posted: Wed Jan 03, 2018 5:39 pm Post subject: |
|
|
"PIDFile /run/tor/tor.pid" in /etc/tor/torrc brings me again "unable to open /run/tor/tor.pid"
if i write "PIDFile /tmp/tor.pid" - no problems, and i have the tor.pid file. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jan 03, 2018 6:23 pm Post subject: |
|
|
SarahS93 ...
you're starting tor via /etc/init.d/tor? ... because the directory (with correct permissions) should be created. Stop tor, set PIDFile to /run/tor/tor.pid, and start, if it errors then check the presence of /run/tor/
edit to add: I just tested, and the directory should be created, and the permissions set, by the init script
Code: | # /etc/init.d/tor start
* /var/run/tor: creating directory
* /var/run/tor: correcting owner
* Starting tor ... [OK] |
HTH & best ... khay |
|
Back to top |
|
|
SarahS93 l33t
Joined: 21 Nov 2013 Posts: 693
|
Posted: Wed Jan 03, 2018 6:44 pm Post subject: |
|
|
Sorry, my mistake, i dont tell you that i run tor not via /etc/init.d/.
I start tor from the console with -f ...torrc, becouse i have four different config files. |
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Wed Jan 03, 2018 7:42 pm Post subject: |
|
|
SarahS93 wrote: | I start tor from the console with -f ...torrc, becouse i have four different config files. |
SarahS93 ... ok, well, you should be able to do the following:
Edit /etc/init.d/tor and add the following addition of "configfile":
Code: | command_args="-f \"$configfile\" --hush --runasdaemon 1 --pidfile \"${pidfile}\""
[...]
checkconfig() {
${command} -f "$configfile" --verify-config --hush > /dev/null 2>&1
if [ $? -ne 0 ] ; then
eerror "Tor configuration (\"$configfile\") is not valid." |
Then create a symlink to /etc/init.d/tor for each of the four instances, and create the respective conf.d/tor.<name>:
Code: | # ln -s /etc/init.d/tor /etc/init.d/tor.foo
# ln -s /etc/init.d/tor /etc/init.d/tor.ba
... etc
# echo "configfile=\"/etc/tor/torrc-foo\"" > /etc/conf.d/tor.foo
# echo "configfile=\"/etc/tor/torrc-ba\"" > /etc/conf.d/tor.ba
... etc
# rm -f /etc/conf.d/tor |
Your four torrc would then be located under /etc/tor/:
Code: | # ls /etc/tor/
torrc-foo
torrc-ba
torrc-bing
torrc-bang |
... and would then start each as '/etc/init.d/tor.<name> start'.
HTH & best ... khay |
|
Back to top |
|
|
pjp Administrator
Joined: 16 Apr 2002 Posts: 20067
|
Posted: Wed Feb 07, 2018 1:46 am Post subject: |
|
|
Moved from Multimedia to Other Things Gentoo. Not related to Multimedia. _________________ Quis separabit? Quo animo? |
|
Back to top |
|
|
|