- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Cron does not stop
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
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
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-18-2006 01:32 PM
тАО02-18-2006 01:32 PM
Cron does not stop
I need to stop the cron job fro applying application patches. Every time I try to stop the cron using "/sbin/init.d/cron stop", the cron daemon does not stop!
Is it b'coz that at that point in time there are child processes owned by cron that the daemon is waiting to complete before shutting itself down ?
To overcome this situation I implmented a ksh function that first attempts a graceful shutdown of cron daemon (/sbin/init.d/cron stop). If cron daemon is still found to be running then function sends kill -9 on the PID of the cron daemon. Are there any negative outcomes of this approach ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-18-2006 03:12 PM
тАО02-18-2006 03:12 PM
Re: Cron does not stop
Also, why kill -9 on first attempt?? You can safely,do as follows.
kill -15
kill -1
kill -2
kill -3
kill -11
and then kill -9. kill -11is equallyeffective and does memory cleanup that kill -15 doesnot do.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-18-2006 03:12 PM
тАО02-18-2006 03:12 PM
Re: Cron does not stop
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2006 09:57 AM
тАО02-19-2006 09:57 AM
Re: Cron does not stop
you no need to stop cron service in terms to stop any running job by cron. Do the follwoing step
#crontab -e (edit the file and comment the line for the service you want to stop)
cheers
indrajit
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-19-2006 01:47 PM
тАО02-19-2006 01:47 PM
Re: Cron does not stop
As usual Bill is right. Further, if you can't get the cron daemon to stop, you may be spawning it in /etc/inittab
Thats a bad idea and you should check inittab and make sure what I'm guessing happened in fact did not happen.
cron daemon is started by root, process 1. A kill -9 will have no effect. If it was permitted to kill process 1, then your system would stop.
kill -9 just so you understand means kill the process and the parent. Its a waste of time to use it on processes whos parent id (PPID) is 1.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО02-20-2006 01:51 AM
тАО02-20-2006 01:51 AM
Re: Cron does not stop
kill -9 does not mean kill the process and its parent. And, it still works fine if the PPID is 1.
You can use ps -ef to track down children of cron to see why it might not be stopping. If you have jobs spawned by cron that don't exit, you should track those down as they can cause problems.
I agree with others that it's not customary to stop cron for an application upgrade. You're better off editing crontab entries if possible. But, stopping cron should work if you want it to.