Bug 250584 - security/tor: Support different fibs for multiple instances
Summary: security/tor: Support different fibs for multiple instances
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Yuri Victorovich
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-10-24 19:10 UTC by Thomas Steen Rasmussen / Tykling
Modified: 2020-11-03 21:23 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (yuri)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Steen Rasmussen / Tykling 2020-10-24 19:10:49 UTC
Hello Tor friends,

I am using the multi instance support introduced in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=207129 to run more than one Tor instance. I want to run some instances with a different routing table, so:


tor_instances="foo bar"
tor_foo_fib=1
tor_bar_fib=2


This currently doesn't work because tor_fib is not set for the so-called "slave" instances (that wording should be changed btw).

The following 1-line patch makes it work, although you may wish to implement it in another way  :)


# git diff tor /usr/local/etc/rc.d/tor 
diff --git a/tor b/usr/local/etc/rc.d/tor
index 57eb6c8..1ca4a70 100755
--- a/tor
+++ b/usr/local/etc/rc.d/tor
@@ -78,6 +78,7 @@ if [ -n "${instance}" ]; then
     tor_conf=${tor_conf}@${inst_name}
     tor_pidfile=${tor_pidfile}@${inst_name}
     tor_datadir=${tor_datadir}/instance@${inst_name}
+    tor_fib=$(eval echo \$tor_${inst_name}_fib)
   fi
   if ! [ -r ${tor_conf} ]; then
     warn "tor instance ${inst_name} config file ${tor_conf} doesn't exist or isn't readable"


I hope we can get this into the port so I don't have to run with a local patch. Thank you!
Comment 1 VVD 2020-10-24 19:26:22 UTC
> tor_fib=$(eval echo \$tor_${inst_name}_fib)
eval tor_fib="\${tor_${inst_name}_fib}"
Comment 2 Thomas Steen Rasmussen / Tykling 2020-11-03 21:23:07 UTC
Hello :)

That works too - I just tested it.

/Thomas