- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Logout users
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 09:55 AM
03-14-2006 09:55 AM
How do I get rid of these sessions other than rebooting my server?
HP-UX 11.0
Thanks for the help.
Jeff
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:00 AM
03-14-2006 10:00 AM
Re: Logout users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:02 AM
03-14-2006 10:02 AM
Re: Logout users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:03 AM
03-14-2006 10:03 AM
Re: Logout users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:04 AM
03-14-2006 10:04 AM
Re: Logout users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:07 AM
03-14-2006 10:07 AM
Re: Logout users
hellickd pts/tN Feb 1 15:07 old 15012 172.16.6.77
root: /home/root ==> kill 15012
kill: 15012: The specified process does not exist.
root: /home/root ==> who -u
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:13 AM
03-14-2006 10:13 AM
Re: Logout users
ps -ef|grep 15012
this will list that user and the parent process..
Try killing that.
If you have lsof installed try seeing the files open by the process
lsof -p 15012
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:17 AM
03-14-2006 10:17 AM
Re: Logout users
One approach would be to use the fwtmp utility to clean up utmp by reading it out in ASCII format, removing the errant entries, and writing it back in binary format. Man fwtmp for details.
A good trick is to send a kill -0 PID to a process. If ${?} is set to 0 then process still exists otherwise, it's bogus.
I suspect that the real answer to this problem is to better educate your users on proper exit procedures.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 10:46 AM
03-14-2006 10:46 AM
Re: Logout users
Is this correct?
/usr/sbin/acct/fwtmp -i wtmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 11:29 AM
03-14-2006 11:29 AM
Re: Logout users
root: / ==> /usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file
I looked at the dummy.file but could not find anything that matched the date of the session that was having problems.
Is there something that I am missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 03:22 PM
03-14-2006 03:22 PM
Re: Logout users
# who -Hu
will give username, pid, time and idle informations. With that you can kill the PID from root user.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 03:23 PM
03-14-2006 03:23 PM
Re: Logout users
# last -R
will give it using /var/adm/wtmp file.
--
Muthu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 04:09 PM
03-14-2006 04:09 PM
Re: Logout users
Lets say, u are seeing the sessions of user1. As a root do the following procedure to make the kill those sessions.
# who -u
# su - user1
$ kill -9 -1
# who -u
Note: Doing this will kill even the active session of the user1. In that case, u need to ask the user1 to logout for a while and not launch any program. I do agree with Clay's point aswell, about educating your user community about clean logouts.
Regards,
Senthil Kumar .A
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2006 04:28 PM
03-14-2006 04:28 PM
Re: Logout users
Hi Jeff,
# who -u
will display username, pid, time and idle informations.
get the pid of the MOST idle user.
use
#kill -9
this will clear the login.
Regards,
Siva.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 04:24 AM
03-15-2006 04:24 AM
Re: Logout users
I tried the â who â Huâ and received the following results:
root: / ==> who -Hu
NAME LINE TIME IDLE PID COMMENTS
hellickd pts/tN Feb 1 15:07 old 15012 172.16.6.77
root: / ==> kill 15012
kill: 15012: The specified process does not exist.
root: / ==> kill -9 15012
kill: 15012: The specified process does not exist.
Then I tried the â last â Râ command and received the following error:
root: / ==> last -R
Memory fault(coredump)
root: / ==>
Senthil,
To do the steps you gave me I will need to change the userâ s password so I can login as them. This is going to take some time and will let you know what happens.
Sivakumar,
I have been trying to kill a user that has been out there for over a month. As you can see by the information in this section I can not kill the session because it doesnâ t exist even though it does exist.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 04:28 AM
03-15-2006 04:28 AM
Re: Logout users
If you can:
# cp /dev/null /var/adm/wtmp
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 04:33 AM
03-15-2006 04:33 AM
Re: Logout users
kill -0 ${THISPID}
STAT=${?}
if [[ ${STAT} -ne 0 ]]
then
this is a dead process; don't restore this line when you rewrite utmp
else
this is a good pid; restore this line when you rewrite utmp
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 04:50 AM
03-15-2006 04:50 AM
Re: Logout users
Still looking?
What type of hpux 11.00 ? (PaRisc 1 or 2)
I remembered compiling a tool
If you are interested I will look for it
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 05:23 AM
03-15-2006 05:23 AM
Re: Logout users
Looking for the source but unlucky for now
Give it a try - I dont know if it works (used to) because I cant recreate your situation to test, I hope it is what I think (because of its name... fixutmp)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 05:57 AM
03-15-2006 05:57 AM
Re: Logout users
root: /etc ==> /usr/sbin/acct/fwtmp < /var/adm/wtmp > dummy.file
root: / ==> vi dummy.file
I found the user by doing a search on the PID and deleted both instances and saved the file.
root: / ==> /usr/sbin/acct/fwtmp -ac < dummy.file > /var/adm/wtmp
After this I did a who â u and see that the user is still there. Is there something else that I need to do now?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 06:36 AM
03-15-2006 06:36 AM
Re: Logout users
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 06:57 AM
03-15-2006 06:57 AM
Re: Logout users
This is what I did:
root: / ==> /usr/sbin/acct/fwtmp < /etc/utmp > dummy.file
Then I located the user and deleted the line from the dummy.file. Then I did this:
root: / ==> /usr/sbin/acct/fwtmp -ac < dummy.file > /etc/utmp
Now when I do a who I get nothing so I logged out and back in and see my sessions. Will the rest of the sessions show up as userâ s login? I would have thought I would have only deleted the one user and the rest of them would have still been there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2006 07:01 AM
03-15-2006 07:01 AM
Re: Logout users
Thanks for the help.
I now have to go back and assign some points to everyone.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2006 11:17 AM
03-17-2006 11:17 AM