Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 756079

Summary: net-vpn/tor - make init-r9 file more generic
Product: Gentoo Linux Reporter: Toralf Förster <toralf>
Component: Current packagesAssignee: Anthony Basile <blueness>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: use SVCname
tor.confd changes

Description Toralf Förster gentoo-dev 2020-11-22 13:50:37 UTC
Hi

the changes below in my local overlay are helpful  to run 2 Tor relays at the same host/IP address. Using them works fine since a longer time here for me.



$ diff net-vpn/tor/files/tor.initd-r9 /var/db/repos/gentoo/net-vpn/tor/files/tor.initd-r9
6,8c6,9
< pidfile=/run/tor/${RC_SVCNAME}.pid
< command_args="-f ${torrc} --hush --runasdaemon 1 --pidfile \"${pidfile}\""
< retry="INT/30/TERM/10/KILL/5"
---
> pidfile=/run/tor/tor.pid
> command_args="--hush --runasdaemon 1 --pidfile \"${pidfile}\""
> retry=${GRACEFUL_TIMEOUT:-60}
> stopsig=INT
18c19
<       ${command} --verify-config -f ${torrc} --hush > /dev/null 2>&1
---
>       ${command} --verify-config --hush > /dev/null 2>&1
20c21
<               eerror "Tor configuration (${torrc}) is not valid."
---
>               eerror "Tor configuration (/etc/tor/torrc) is not valid."



Just FWIW I shameless created a -9999 ebuild from yours, but changed it slightly wrt "zstd", "test" and "coverage" and the sort order of --enable statements.

It can be found at https://github.com/toralf/tgro/tree/master/net-vpn/tor
Comment 1 Anthony Basile gentoo-dev 2020-11-22 16:05:45 UTC
> < retry="INT/30/TERM/10/KILL/5"
> ---
> > retry=${GRACEFUL_TIMEOUT:-60}
> > stopsig=INT

Is this the same behaviour?  There was a reason from the INT/30/TERM/10/KILL/5.

> Just FWIW I shameless created a -9999 ebuild from yours, but changed it
> slightly wrt "zstd", "test" and "coverage" and the sort order of --enable
> statements.

I'll have to look at that.
Comment 2 Toralf Förster gentoo-dev 2020-11-22 16:12:15 UTC
(In reply to Anthony Basile from comment #1)
> > < retry="INT/30/TERM/10/KILL/5"
> > ---
> > > retry=${GRACEFUL_TIMEOUT:-60}
> > > stopsig=INT
> 
> Is this the same behaviour?  There was a reason from the
> INT/30/TERM/10/KILL/5.

The current git HEAD suffers from an issue here under hardened stable, that usually after 1-2 days of runtime neither INT nor USR1 (and sometimes not even TERM) are accepted : https://gitlab.torproject.org/tpo/core/tor/-/issues/40185
That's why I changed that too


But yes - that's independed from the torrc file handling and the USE flag evaluation. The former allows me to simply symlink tor to tor2 here.
Comment 3 Anthony Basile gentoo-dev 2020-11-29 20:36:16 UTC
(In reply to Toralf Förster from comment #2)
> (In reply to Anthony Basile from comment #1)
> > > < retry="INT/30/TERM/10/KILL/5"
> > > ---
> > > > retry=${GRACEFUL_TIMEOUT:-60}
> > > > stopsig=INT
> > 
> > Is this the same behaviour?  There was a reason from the
> > INT/30/TERM/10/KILL/5.
> 
> The current git HEAD suffers from an issue here under hardened stable, that
> usually after 1-2 days of runtime neither INT nor USR1 (and sometimes not
> even TERM) are accepted :
> https://gitlab.torproject.org/tpo/core/tor/-/issues/40185
> That's why I changed that too
> 
> 
> But yes - that's independed from the torrc file handling and the USE flag
> evaluation. The former allows me to simply symlink tor to tor2 here.

Go ahead and commit this to the tree, but don't touch the current stable version.  You can add it to -9999 and the current unstable alpha for testing.  Please test!!! and then close the bug.
Comment 4 Toralf Förster gentoo-dev 2020-12-01 15:27:51 UTC
(In reply to Anthony Basile from comment #3)
> Go ahead and commit this to the tree

I do not have commit access to the Gentoo tree.
Comment 5 Anthony Basile gentoo-dev 2020-12-06 21:18:28 UTC
(In reply to Toralf Förster from comment #4)
> (In reply to Anthony Basile from comment #3)
> > Go ahead and commit this to the tree
> 
> I do not have commit access to the Gentoo tree.

Please provide a patch.
Comment 6 Toralf Förster gentoo-dev 2020-12-20 14:09:54 UTC
Created attachment 678933 [details, diff]
use SVCname
Comment 7 Toralf Förster gentoo-dev 2021-01-20 21:50:21 UTC
Created attachment 683929 [details, diff]
tor.confd changes