login_activity doesn't work on Ubuntu precise 12.04
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
TurnOff |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
I believe the output of "who" has changed and the simple check
if login != "" and "(:0" not in login:
doesn't work any more. This is what it looks like now:
$ who
mythtv tty7 2012-10-28 09:27
tom pts/6 2012-10-28 19:49 (192.168.1.11)
My solution is to match against pts/x to find out if anyone's logged in remotely as local logins show up as tty/x.
Patch:
=== modified file 'src/turnoff/
--- src/turnoff/
+++ src/turnoff/
@@ -19,7 +19,7 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
"""
-import activity
+import activity, re
from activity import Activity
from globals import log, run
@@ -31,7 +31,8 @@
def is_idle(self):
logins = run("who"
for login in logins:
- if login != "" and "(:0" not in login:
+ #if login != "" and "(:0" not in login:
+ if re.match(
return True
Related branches
description: | updated |
Changed in turnoff: | |
status: | Fix Committed → Fix Released |
OK, this fix committed, thanks. Please test.