1834165 Members
2275 Online
110064 Solutions
New Discussion

A question

 
Ali Imran Abbas
Regular Advisor

A question

What happens if some thing is already running on the machine and u give that command accidently. I explain my scenarion:

I was going to check the cron logs by moving to var/adm/cron. I changed directories to var/adm and instead of typing cd cron there, I typed cron by error. The machine gave me the following error:
cron
unix20:# ! cron is already running Mon Jan 7 08:39:10 EST 2008
! ******* CRON ABORTED ******** Mon Jan 7 08:39:10 EST 2008

I am just kinda curious if that thing is of big issue or not. Because that machine is the main production server.

An earlier reply is highly appreciated.

Regards,

Ali
4 REPLIES 4
Oviwan
Honored Contributor

Re: A question

hey

use this to check whether cron is still running or not:

ps -ef | grep cron

Regards
Pete Randall
Outstanding Contributor

Re: A question

Just check to make sure that cron is, in fact, running:

ps -ef |grep cron


Pete

Pete
Francis Noël
Regular Advisor

Re: A question

Hello Ali

Your scenario is actually a pretty good example of what *can* happen.

In this case you attempted to start a daemon while an instance of it was already running. Cron started up, checked to see if another instance was already running, found one, informed you of this fact and then exited. Nothing got broken.

The important thing to notice here is that cron was *smart* enough to check for a running instance *before* doing anything else. Some less sophisticated software (or command) might not do that.

So the answer to your question is "it depends". It depends on what command you run and how that particular software handles the situation.

Hope this helps.
Rita C Workman
Honored Contributor

Re: A question

Since you now know you didn't kill anything....

For reviewing the logs, why bother to copy them, thus opening yourself up for a typo.

If all you want to do is review, then just type:

#more /var/adm/cron/log

Rgrds,
Rita