- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Terminate process
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
06-21-2005 01:38 PM
06-21-2005 01:38 PM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2005 03:33 PM
06-21-2005 03:33 PM
SolutionIt gets complicated if you want to do this automatically. There may be multiple processes, you wil have to verify you are killing the right process, etc,
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2005 05:47 PM
06-21-2005 05:47 PM
Re: Terminate process
# ps -u oracle_usr | awk '!/PID/ { split($3,a,":");if (a[1]==10) { print $0 }}'
To kill them then,
# ps -u oracle_usr | awk '!/PID/ { split($3,a,":");if (a[1]==10) { print $1 }}' | xargs kill -9
hth.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2005 10:35 PM
06-21-2005 10:35 PM
Re: Terminate process
may be my server have problem to run split , it pop the message "usage: kill [ -s signal | -p ] [ -a ] pid ..." , could suggest another simplier script ? thx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-21-2005 10:53 PM
06-21-2005 10:53 PM
Re: Terminate process
Another way of doing would like this:
1.
# w
-bash-2.05b# w
6:50am up 1 day, 23:53, 2 users, load average: 0.00, 0.00, 0.00
User tty login@ idle JCPU PCPU what
oracle_usr pts/ta 6:28am 23:59 -bash
root pts/tb 6:50am w
From the command above i know that oracle_usr is associated with terminal pts/ta
then do :
2.
# ps -t pts/ta
-bash-2.05b# ps -tpts/ta
PID TTY TIME COMMAND
6226 pts/ta 0:00 -bash
6225 pts/ta 0:00 telnetd
-bash-2.05b#
This will display all the process associated with that user. Say i have to kill bash then:
3.
# kill -9 6226
This should work.
Regards,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-22-2005 01:55 AM
06-22-2005 01:55 AM
Re: Terminate process
ps -u oracle_user | grep -v PID | awk '{ split($3, a, ":"); if(a[1] > 10) print $1;}' | xargs kill -9