Opened 8 years ago

Closed 8 years ago

Last modified 7 years ago

#5076 closed defect (duplicate)

"Could not setup the environment of the managed proxy" when using init script

Reported by: asn Owned by:
Priority: Medium Milestone: Tor: 0.2.3.x-final
Component: Core Tor/Tor Version:
Severity: Keywords: tor-bridge
Cc: twilde@… Actual Points:
Parent ID: Points:
Reviewer: Sponsor:


tor needs to pass the values of the environment variables PATH and HOME to the managed proxy. If it can't find those variables in its environment, it will fail with:

[warn] Could not setup the environment of the managed proxy at '/usr/local/bin/obfsproxy'.

People have encountered this, when they tried to use managed proxies with an init. script, and they init. script didn't set up those two variables before spawning tor.

We should work around this.

Child Tickets

Change History (6)

comment:1 Changed 8 years ago by twilde

Adding "export HOME=$TORDATA" after the TORARGS lines in the tor/contrib/torctl script allows this to work properly, and I don't /think/ it should have any problematic side effects. It /might/ be better to do it specifically for the tor call, but torctl isn't going to be doing anything else, so exporting to its environment shouldn't hurt anything.

comment:2 Changed 8 years ago by twilde

Cc: twilde@… added

Since we have an or_options_t, perhaps if we don't get home_env from the environment we could just default it to the data directory Tor is using? I don't know the data structures well enough to know if that's actually present in the or_options_t, but it seems like it would be a reasonably simple fix that wouldn't compromise security/etc in any way (and gets rid of any OS-specific startup script hackery). This would be around line 1074 or transports.c if I'm reading correctly.

comment:3 Changed 8 years ago by ioerror

I looked at the code in or/transports.c and it seems that set_managed_proxy_environment does this - isn't this just an init.d script issue?

comment:4 Changed 8 years ago by Sebastian

Resolution: duplicate
Status: newclosed

Closing as duplicate of #5082

comment:5 Changed 7 years ago by nickm

Keywords: tor-bridge added

comment:6 Changed 7 years ago by nickm

Component: Tor BridgeTor
Note: See TracTickets for help on using tickets.