- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to kill specific cron job
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
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
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
тАО02-07-2003 09:17 AM
тАО02-07-2003 09:17 AM
how to kill specific cron job
Is it easiest just to kill the main cron daemon then restart using:
# /sbin/init.d/cron stop
# /sbin/init.d/cron start
or are there implications to doing this on a 24/7 prod system.
All input very gratefully received.
James.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 09:26 AM
тАО02-07-2003 09:26 AM
Re: how to kill specific cron job
A little example about:
#ps -ef|grep
root 3930 3929 0 Jan 25 ? 93:40
#kill -9 3990
-9 is the signal number, the following table describes a few of the more common signals that can be useful.
signum signame Name Description
___________________________________________________________________________
0 SIGNULL Null Check access to pid
1 SIGHUP Hangup Terminate; can be trapped
2 SIGINT Interrupt Terminate; can be trapped
3 SIGQUIT Quit Terminate with core dump; can be trapped
9 SIGKILL Kill Forced termination; cannot be trapped
15 SIGTERM Terminate Terminate; can be trapped
24 SIGSTOP Stop Pause the process; cannot be trapped
25 SIGTSTP Terminal stop Pause the process; can be trapped
26 SIGCONT Continue Run a stopped process
Rgds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 09:31 AM
тАО02-07-2003 09:31 AM
Re: how to kill specific cron job
I would try killing the two child processes. If the other processes are well behaved they should die also.
I would NOT do a 'kill -9' until you have exhausted all the other, safer signals first. Try 'kill -15', 'kill -2' first. The 'kill -9' will nail the processes and they will leave open any files, shared memory segments, etc. that they had open.
JP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 09:34 AM
тАО02-07-2003 09:34 AM
Re: how to kill specific cron job
Like you run the program using the cron utility, maybe its a good idea to create a script that check the child process and kill them !
You can put the lines :
ps -ef | grep
take the pid from the process and so kill it:
kill
kill -9
Regards,
Ricardo Bassoi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 10:04 AM
тАО02-07-2003 10:04 AM
Re: how to kill specific cron job
Sometimes, hitting them with a kill -9 won't kill them, but cause them to become zombies. These can only be killed by a system reboot.
Basically, if you use kill -9 a process, check again the process ID with ps -ef|grep PID. If the process ID remains, and its parent is 1 or 0, you've probably created a zombie. You can try kill -9 on that process as many times as you'd like, but if it doesn't go away, you'll have to schedule a reboot to clean up the process table. Usually, zombies are more of an annoyance than an actual problem. However, there are situation where they hold a file descriptor open, or otherwise get in the way of another process. If the application is properly written, a kill -15 terminates it properly, and you won't have to go to the extreme measure of using the kill -9.
Good Luck
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 10:09 AM
тАО02-07-2003 10:09 AM
Re: how to kill specific cron job
Just a tip on using ps. If you want to see more of the actual command line use:
ps -efx
and you'll get extended output.
HTH,
Jeff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-07-2003 12:15 PM
тАО02-07-2003 12:15 PM