From c55b844ad129d1186af61c68fe5761d9ffcc72ea Mon Sep 17 00:00:00 2001 From: brent s Date: Fri, 18 Jan 2019 15:12:17 -0500 Subject: [PATCH] no WONDER that wasn't working --- sys/user_cull.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/user_cull.py b/sys/user_cull.py index ee28ceb..9ba936f 100755 --- a/sys/user_cull.py +++ b/sys/user_cull.py @@ -5,6 +5,9 @@ # - SSH timeout can be overridden client-side # - $TMOUT can be overridden user-side # we need to actually kill the sshd process attached to the SSH session. +# This does have some limitations, though. Namely, it doesn't work for screen/tmux sessions. +# specifically if they happen to be using byobu with a status bar that updates, because that process +# gathering information for the status bar counts as "activity". Go figure. import datetime import os @@ -35,7 +38,7 @@ exclude_users = [] # Get the SSHD PIDs. -ssh_pids = [p for p in psutil.process_iter() if p.name() == 'sshd'] +ssh_pids = [p.pid for p in psutil.process_iter() if p.name() == 'sshd'] # If the timeout is set to auto, try to find it. if timeout == 'auto': import re