1838492 Members
2474 Online
110126 Solutions
New Discussion

Cron Problem

 
SOLVED
Go to solution
james1964
Advisor

Cron Problem

I have a very strange problem. I run a few scripts in the root cron. Most of the scripts a running fine. I have 2 that are not running like they are suppose to. They have worked fine for about a year without problem. About 3 weeks ago we has a power outage. We have battery backups to keep are servers up about an hour. I manually shutdown this server before it lost power using the shutdown -h 0. When I brought up the server, most of the processes that are in rc1 did not automatically start like they are suppose to. I ended up starting most everything manually. This server is a key to our shopping cart login so I don't want to have to reboot it again. When I try to run a cron stop, cron start, or cron status I get the following

# ! cron is already running Fri Oct 17 09:50:13 CDT 2008
! ******* CRON ABORTED ******** Fri Oct 17 09:50:13 CDT 2008

Is there a way I can kill this process and try to start it again?
6 REPLIES 6
John Guster
Trusted Contributor
Solution

Re: Cron Problem

Asuming it is HP-UX system.
ps -ef|grep cron does that tell cron daemon is up? check /etc/inittab, maybe you have respawn set up for corn daemon. If so, you just need run cron stop, system will bring cron daemon up.
Pete Randall
Outstanding Contributor

Re: Cron Problem

I would be interested in just what caused "most of the processes that are in rc1" to fail. Can you provide any further info on that? I feel that these failures have to be related to your cron issues, but can't yet see the connection.


Pete

Pete
james1964
Advisor

Re: Cron Problem

When I type the command iget the following output. It looks like it is stopped to me, but I have another script in the cron that creates files every 10 minutes and those files are being created.

# ps -ef|grep cron
root 18973 1 0 09:27:04 ? 0:00 cron stop
root 27917 18690 1 11:28:12 pts/tJ 0:00 grep cron

I am running HP_UX 11i. I am not sure why things did not auto start. They usually do. I agree that it is related, but I am not sure how to track why it did what it did.
Dennis Handly
Acclaimed Contributor

Re: Cron Problem

>I am not sure why things did not auto start.

Take a look at /etc/rc.log and the old one?
Also /var/adm/cron/log.

>cron stop

There is no such option documented. cron(1m) says you should use: /sbin/init.d/cron
james1964
Advisor

Re: Cron Problem

The cron was stuck in a half way position. I guess it was trying to stop. Using the ps command you gave me, (Thank you, I should have thought of that) I killed the cron. Then I was able to start and stop it with no problems. All of my cron jobs are running now. I am curious why things did not auto start as well. I will search the logs you suggested to see if I can find anything. Thanks for the help.
james1964
Advisor

Re: Cron Problem

I killed the process and was able to start and stop after that with no problems.