Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to stop the "corn" process on AIX 5.1

Status
Not open for further replies.

28814840

MIS
Mar 21, 2004
7
HK
Dear all,

As I want to stop "corn" process at AIX 5.1 for management tool(HP operation)testing.
How can I kill the corn daemon?

Since I try to issued "kill -9 <PID of corn>", the corn daemon will automatically create a new daemon immediately??

Please help me???

Regards, BennyYeung
 
Normally you will be able to kill any process issued by crontab.
However if this is one of the inittab processes that has a "respawn" flag in /etc/inittab - the system will respawn this process every time you kill it.

&quot;Long live king Moshiach !&quot;
 
Hi levw,

As you mentioned that remove the "respawn" flag /etc/inittab and then used crontab to kill the corn daemon, it will not restart the daemon after I killed??

Regards, BennyYeung
 
Right,

but do not just remove the flag "respawn" - change it to "once:.Example:

cons:0123456789:respawn:/usr/sbin/getty /dev/console

change to:

cons:0123456789:eek:nce:/usr/sbin/getty /dev/console



&quot;Long live king Moshiach !&quot;
 
One more issue,

In case I killed corn process, how can I restart the corn??
Also issued "corntab" to start the corn?

Please advice, Thanks!
Regards, BennyYeung
 
If you kill a crontab process,it will run next time the schedule tells it to.

Or you just cut&paste ,then run the command from the "crontab -l" and run it.

&quot;Long live king Moshiach !&quot;
 
One thing I needed to clarify, if I killed "corntab" process,it will cause the all cron job disabled??

 
NEVER kill the /usr/sbin/cron (the crontab itself),just kill one of the processes it fired ,if you really have to.

&quot;Long live king Moshiach !&quot;
 
Since I needed to having a testing, which monitoring the corn process is health to run. So I want to kill the corn process for testing.

Any think I can do it for corn process killing?

Regards, BennyYeung
 
your only way is to change the line in /etc/inittab:

cron:2:respawn:/usr/sbin/cron

to

cron:2:eek:nce:/usr/sbin/cron

But remember to change it back later !!!!


&quot;Long live king Moshiach !&quot;
 

You want to monitor if crond is running or not? What is the complete reason to do this? I am really curious - a I never felt the need to monitor something like crond.

Well, if you are creating a monitoring environement - I think - there are more important things to monitor. I think we can trust the init process enough to keep crond alive.

I know, I was not helpful now, but I am trying to be...

--Trifo

 

Well, I have found a way to monitor crond:

you have to define a 'hearthbeat' job in crontab which should run in every minute. Say - it touches a file.

* * * * * touch /hearthbeat.file


and there might be an other side of the monitoring environement which checks if /hearthbeat.file is older than 1 minute or not. If it is older, there is a problem im the machinery if crond.

I do not know how init checks is a process needs respawning. Thus I do not know if it can detect a hanging process, but this way you can be sure, cron is working.

--Trifo
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top