How to kill pids for all sessions for a specific user except their current one?
Hey, I have several users on handhelds and they like to let their sessions time out. Their zombie processes then cause record locks.
A solution I've come up with calls for killing the pids for any prior sessions started by a given user. This procedure would be executed in the .bash_profile. Problem is, I have no idea how to do this. Thanks in advance for any help!
Delete My account
Thanks, I appreciate your response. I'm familiar with kill and killall, w and ps, but not the code that would do what I need it to do. Maybe this will give you a better idea of what I'm trying to do. -Jason
[root@lynx dsi]# w |grep dsi
dsi pts/7 192.168.1.120 13:53 1:21m 0.03s 0.01s sshd: dsi [priv
dsi pts/4 192.168.1.120 13:53 0.00s 0.04s 0.01s sshd: dsi [priv
#Idle for pts/7 not 0. pts/7 must be the disconnected session.
[root@lynx dsi]# ps uU dsi |grep pts7
dsi 14341 0.0 0.0 7772 1420 ? S 13:53 0:00 sshd: dsi@pts/7
dsi 14342 0.0 0.0 4316 1440 pts/7 Ss 13:53 0:00 -bash
#Grab pids and kill them:
kill 14341 14342
kill -9 14341 14342
I figured some things out and started a new thread here:
|All times are GMT -5. The time now is 07:10 AM.|