Opened 7 years ago

Closed 7 years ago

#6351 closed defect (not a bug)

tor uptime is not reported

Reported by: hsn Owned by: atagar
Priority: Low Milestone:
Component: Core Tor/Nyx Version:
Severity: Keywords:
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

arm - slush.phatservers.com (FreeBSD...)   Tor 0.2.2.37 (recommended)
FILEZcom2 - 64.6.104.19:4443, Dir Port: 8080, Control Socket: /var/run/tor/torct
cpu: 0% tor, 0.7% arm      mem: 0 (0%)         pid: 73723  uptime:
fingerprint: ADE3DA05124A033FF4B27956D074FFAD76A53848
flags: none

On FreeBSD 7 and 8. tor uptime is not reported. I didnt tried it on linux.

Child Tickets

Change History (5)

comment:1 Changed 7 years ago by atagar

Priority: normalminor

The uptime that arm reports is based on ps results when running on BSD. If I'm unable to parse the value then it's left blank. I recall that OpenBSD has a particularly insane value for this field, providing the time that the process started in *local 12-hour time*. In that case I figured they deserved for me to treat it as being unparseable. :P

That said, I thought that this worked on FreeBSD. Here's the part where I parse the ps results...
https://gitweb.torproject.org/arm.git/blob/HEAD:/src/util/sysTools.py#l495

In particular, the uiTools.parseShortTimeLabel() function...
https://gitweb.torproject.org/arm.git/blob/HEAD:/src/util/uiTools.py#l493

Patches welcome if you want to make this accommodate whatever FreeBSD is giving you.

comment:2 Changed 7 years ago by hsn

Tor does not reports uptime on control socket? It is reported to directory in descriptor.

comment:3 Changed 7 years ago by hsn

here is output of ps command on freebsd 8

ps -p 54002 -o cputime,etime,rss,%mem

TIME ELAPSED RSS %MEM

17:47.15 11-09:26:33 5364 0.1

comment:4 Changed 7 years ago by hsn

Because tor is running under different UID from running arm, tor process is not visible, so ps will return nothing.

comment:5 Changed 7 years ago by atagar

Resolution: not a bug
Status: newclosed

Because tor is running under different UID from running arm, tor process is not visible, so ps will return nothing.

Ahhh, that makes sense. Arm often has issues getting connection information when running under a different uid. I'm not surprised that it has issues with ps information on some platforms too. The readme suggests running under the same user as tor...
https://gitweb.torproject.org/arm.git/blob/HEAD:/README#l44

Feel free to reopen if you'd like to discuss this more.

Note: See TracTickets for help on using tickets.