On Sat, Dec 04, 2010 at 07:49:58PM -0800, Damian Johnson wrote: > ... > > For BSD I'm using the following commands: > sockstat -4 | egrep '<process>\s*<pid>' | grep -v '*:*' > procstat -f 'pgrep <process>' | grep '<pid>' | grep -v '0.0.0.0:0' > > The purpose of these greps is to only get established connections and > to filter by the pid (in case there's multiple tor instances). > > To test please do the following: > 1. Run arm at its debug runlevel ("arm -e 1")
15:08:52 [ARM_INFO] Terminal color support detected and enabled 15:08:52 [ARM_DEBUG] GETINFO events/names (runtime: 0.0002) [1 duplicate hidden] 15:08:52 [ARM_DEBUG] GETCONF ORPort (cache fetch) [19 duplicates hidden] 15:08:52 [ARM_DEBUG] GETINFO accounting/enabled (runtime: 0.0001) 15:08:52 [ARM_DEBUG] GETINFO desc/id/Unknown (runtime: 0.0001) 15:08:52 [ARM_DEBUG] GETINFO fingerprint (cache fetch) [2 duplicates hidden] 15:08:52 [ARM_WARN] Unable to resolve tor pid, abandoning connection listing 15:08:52 [ARM_DEBUG] GETINFO config/names (runtime: 0.0012) 15:08:52 [ARM_DEBUG] GETINFO config-text (runtime: 0.0016) ------------------- 15:08:51 [ARM_DEBUG] system call: sockstat -4c | grep 'tor' (runtime: 0.00) -------------------- 15:08:51 [ARM_DEBUG] GETINFO ns/id/Unknown (runtime: 0.0002) 15:08:51 [ARM_DEBUG] GETINFO fingerprint (runtime: 0.0002) 15:08:51 [ARM_DEBUG] GETINFO address (runtime: 0.0003) 15:08:51 [ARM_DEBUG] GETINFO status/version/current (runtime: 0.0002) 15:08:51 [ARM_DEBUG] GETINFO version (cache fetch) ---------------- 15:08:51 [ARM_INFO] Operating System: FreeBSD, Connection Resolvers: sockstat (bsd), procstat (bsd) ---------------- 15:08:51 [ARM_WARN] Unable to load torrc (no such file or directory: '/path/to/torrc') ### this is the path on the host, tor is running in a jail 15:08:51 [ARM_DEBUG] GETINFO config-file (runtime: 0.0002) 15:08:51 [ARM_DEBUG] system call: ps -o pid -C tor (runtime: 0.00) 15:08:51 [ARM_DEBUG] system call: netstat -npl | grep 127.0.0.1:9051 (runtime: 0.00) ### ???? 15:08:51 [ARM_INFO] system call (failed): pidof tor (error: 'pidof' is unavailable) 15:08:51 [ARM_INFO] Loaded configuration descriptions from '/tmp/arm/torConfigDescriptions.txt' (runtime: 0.000) 15:08:51 [ARM_DEBUG] GETINFO version (runtime: 0.0002) 15:08:45 [ARM_NOTICE] No configuration found at '/home/user/.armrc', using defaults > > 2. Arm defaults to the bsd resolvers if os.uname() matches "FreeBSD". > Please look for an entry like the following in your logs (it'll be > near the start): See above. > 3. Go to arm's second page and press "u" to bring up the resolver > options. Regardless of the OS detected it will have: > * auto > * netstat > * ss > * lsof > * sockstat > * sockstat (bsd) > * procstat (bsd) To make it short: the sockstat (bsd) option works on FreeBSD 7.4-PRERELEASE. This is nice. See above for log. > > > That said, from the link you provided it looks like this isn't > necessary. What arm currently attempts is: > lsof -nPi | grep "<process>\s*<pid>.*(ESTABLISHED)" > > If FreeBSD has an equivalents for the flags (n = prevent dns lookups, > P = show port numbers (not names), i = ip only) then please show me > what its output looks like and I'd be happy to add it as another > fallback resolver. > > What order should sockstat, procstat, and lsof be attempted in? Are > any of them preferable due to jails over the others? I would avoid lsof. *********************************************************************** To unsubscribe, send an e-mail to majord...@torproject.org with unsubscribe or-talk in the body. http://archives.seul.org/or/talk/