- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Kill the Process dynamically
Categories
Company
Local Language
Forums
Discussions
Knowledge Base
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
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
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
08-04-2008 11:55 PM
08-04-2008 11:55 PM
I have sapdisp application, unfortunately this application doesnt have the utility to stop the application, every time i need to kill the process to stop this.
So i need to make a script which can filter the PID of this application and kill the process dynamically.
Please can any one help me on this....
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 12:00 AM
08-05-2008 12:00 AM
Re: Kill the Process dynamically
$ ps -ef | grep -v grep | grep syslog | awk '{print $2}'
963
$ ps -ef | grep 963
root 963 1 0 Dec 3 ? 0:25 /usr/sbin/syslogd -D
regards,
ivan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 12:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 05:37 AM
08-05-2008 05:37 AM
Re: Kill the Process dynamically
kill $(UNIX95=1 ps -C sapdispdaemon -opid=)
You should test it first by adding an echo and then: ps -fp the-pid
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2008 05:44 AM
08-05-2008 05:44 AM
Re: Kill the Process dynamically
As Dennis suggests, use the UNIX95 (XPG) behavior of 'ps' with '-C' to find the process you want.
Finding a process with 'grep' can lead to false positives. Using 'ps -C
Too, do NOT use 'kill -9' except as a very last resort. A 'kill -9' can't be caught and hence your process will have no chance to cleanup temporary files and/or shared memory.
Start with a 'kill -hup' then a 'kill -term' [the default] and then only as a last resort issue a 'kill -9'.
Regards!
...JRF...