- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- kill old user
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-31-2008 09:30 PM
03-31-2008 09:30 PM
kill old user
In my HP-UX server machine i have some old user which i cannt kill. please tell me how can i delete those. here is as example :
jarhadta pts/22 Feb 15 00:50 old 9540 10.236.0.207
here jarhadta is an ldap user and i want to kill this process 9540 which status is old.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 09:50 PM
03-31-2008 09:50 PM
Re: kill old user
ps -ef|grep $1|grep user| awk '{ print $2; }'|xargs kill -9
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 10:16 PM
03-31-2008 10:16 PM
Re: kill old user
ps -elf|grep 9540
check what is the status of process
S/U/R
if U u can not kill it , reboot is the only option.
else simply kill -9 9540.
Please tell if u facing sm error.
BR,
kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 10:30 PM
03-31-2008 10:30 PM
Re: kill old user
"$ ps -elf | grep 9540
1 S sysop 2711 19455 1 154 20 c0e72700 23 f8d021b6 12:30:11 pts/3 0:00 grep 9540"
I tried by kill -9 command but failed to kill. please tell me the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 10:42 PM
03-31-2008 10:42 PM
Re: kill old user
1 S sysop 2711 19455 1 154 20 c0e72700 23 f8d021b6 12:30:11 pts/3 0:00 grep 9540"
are you user sysop???
because from this I can see there is no process like 9450.
Its already killed I suppose this line is for the command u fired ie grep
BR,
Kapil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 10:49 PM
03-31-2008 10:49 PM
Re: kill old user
** what does status old mean?
Please give me solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-31-2008 11:17 PM
03-31-2008 11:17 PM
Re: kill old user
The user you are talking is dead user. Coz u will not find the user in the command "ps -ef|grep jarhadta" it will not show you anything.coz the user connected through LDAP.
and only when you used "w" command that time you will see the user.
So the output comes from file /var/adm/btmp.
So one way is flash the file.
Thanks & Regards
Aashique
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2008 05:14 PM
04-02-2008 05:14 PM
Re: kill old user
Do you want to kill the user or the process belongs to the user ?
If you want to kill the process belongs to the user, use, ps -ef command.
If you want to kill the user, use who -u command to find the user and kill him. Whatever the processes belongs to the user, will terminate, once you kill the original user.
Thanks
Shibin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2008 06:19 PM
04-02-2008 06:19 PM
Re: kill old user
"-u Lists only those users who are currently logged in. name is the user's login name. line is the name of the line as found in the directory /dev. The time field indicates when the user logged in. activity is the number of hours and minutes since input activity last occurred on that particular line. A dot (.) indicates that the terminal has seen activity in the last minute and is therefore ``current''. If more than twenty-four hours have elapsed or the line has not been used since boot time, the entry is marked old. This field is useful when trying to determine whether a person is working at the terminal or not."
> ** what does status old mean?
The user has been logged in but no terminal activity for more than 24 hours.
> kill -9 .. doesn't work
That is quite normal for a process that is hung on an I/O (almost always networking) that will never complete. kill doesn't actually stop a program. Instead, it sets a flag (a signal) in the program's process table and the next moment that the program starts running again, the signal will be processed. All signals except -9 can be handled (trapped) by a program. For kill -9, the program will terminate unconditionally when the program starts the next instruction.
So until the process (9540) completes the I/O, it will hang forever. NOTE: it consumes no resources in the system. There is an entry in the process table but it has been suspended. So ignore the process and the associated user.
> ps -elf | grep 9540
> ps -ef|grep $1|grep user| awk '{ print $2; }'|xargs kill -9
Please, don't use grep with ps!!! The first example will find PID 9540 but also find PID 19540 and command line values such as abc9540zz or index:195400. If you kill everything returned by this grep, you'll break unrelated processes. You will get an EXACT match with ps. The man page is very helpful:
ps -lfp 9540
ps reads the process table knows exactly which process is 9540.
The second example is even more dangerous as it uses grep for a particular user but it will find the user's ID in many different locations on the line -- grep has no concept of a field or column. Again, ps knows exactly how to find a specific user:
ps -flu jarhadta
But remember that ps will find all processes owned by that user ID. As mentioned, there are other processes owned by this user that are not to be terminated.
But there are also many other unused options for ps, specifically -H, -C and -o. -H shows processes sorted and indented based on hierarchy, so each process tree can be seen. -C matches an exact process name (no grep), and -o eliminates the need for awk to parse the line by showing just the desired fields. NOTE: all of these options require temporary setting of the UNIX95 variable so to find all sh processes use this (exactly as shown):
UNIX95=1 ps -fC sh
compare that with:
ps -ef | grep sh
Lots of mistakes with grep...
Also try this:
UNIX95=1 ps -efH
shows all processes sorted by hierarchy (parent - child). You can combine _H with other selections like user ID:
UNIX95=1 ps -fHu billh
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-02-2008 08:18 PM
04-02-2008 08:18 PM
Re: kill old user
ps -elf|grep 9450|grep -v grep
I think u wont find anything.......
pls send output of
who -u |grep
BR,
Kapil