- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: KIll 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
09-10-2002 02:50 AM
09-10-2002 02:50 AM
KIll Process
I know that someone out there will know an easy way to cure my problem.
i need to kill a specific process ate shutdown level2 i am trying to use
"ps -ef | grep (process name) | cut ( to select pid) | kill -9"
to remove said process although there may be an easier way.
can anyone help and tell me the best command string to use to select the process and kill it, i am going to put this script at run level 2.
regards
andy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 02:55 AM
09-10-2002 02:55 AM
Re: KIll Process
Here's a good thread about process killing:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xc8d7a135f587d5118ff00090279cd0f9,00.html
HTH,
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 02:56 AM
09-10-2002 02:56 AM
Re: KIll Process
Using ps then cut is a normal way to do it, only one thing to remember, use grep -v grep in the command or else you may end up only killing your grep (process name) pid, not the real pid you wanted to kill !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 05:27 AM
09-10-2002 05:27 AM
Re: KIll Process
kill the process with a simple
command:
kill -KILL $(cat process.pid)
I use the following function which is cleaner.
kill_job () {
pid=`cat ${pid_file}`
if [ -f ${pid_file} ]; then
if ps -p ${pid} > /dev/null; then
kill -KILL ${pid}
fi
rm -f ${pid_file}
fi
}
The pidfile is create with
echo $! > ${pid_file}
executed immediately after the command is run.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 06:58 AM
09-10-2002 06:58 AM
Re: KIll Process
/sbin/init.d/processName stop
Command and use a process number linked to a KILL script in rc2.d
Unless you know exactly what this script does.
Without knowing the details, using the kill -9 described above might leave some things floating around your system.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 07:28 AM
09-10-2002 07:28 AM
Re: KIll Process
kill -9 $(ps -ef | grep
Ray
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 07:52 AM
09-10-2002 07:52 AM
Re: KIll Process
I would use, in the following order:
-15 (terminate)
-1 (hangup)
-3 (quit)
and as a last resort -9 (kill)
HTH
Marty
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2002 11:00 AM
09-10-2002 11:00 AM