Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I used to get local mail reporting the stdout of nightly cron jobs. those emails have stopped. in trying to figure out why, I notice that service --status-all has the message:
anacron dead but subsys locked
I figure something in anacron generates those emails. anyhow...how do I resolve the anacron message?
check your syslog for "cron" messages about anacron, stopping anacron will remove lock in /var/lock/subsys, then restart anacron, if it fails again check all stuff anacron needs (config, dirs, timestamp file etc etc), weird cron jobs, and watch it (add "-d" on the cmdline).
should I reinstall anacron??
Not unless you can't fix it. First check your logs for errors.
Next determine if the rpm package ain't bad:
get the rpm: "rpm -q -a | grep anacron", then "rpm -V <rpm>".
Next move /etc/cron.daily/00{-logwatch,webalizer} to have a higher number, 0anacron should always be run first.
Next try to run anacron with the "-d" option to watch it post info to the screen (and also to the logfile), and add "-n" to force anacron to run the jobs regardless of the delay.
If anacron doesn't die then, you should try and retrace your steps regarding to changing configs or upgrading/installing stuff that (this) anacron (version) depends on.
Btw, is this the last version of anacron you're using?
[root@roadking root]# cat /var/log/messages | grep cron
May 4 14:35:05 roadking crond: crond shutdown succeeded
May 4 14:35:06 roadking crond: crond startup succeeded
May 6 16:22:37 roadking crond: crond shutdown succeeded
May 6 16:25:18 roadking crond: crond startup succeeded
May 6 16:25:21 roadking anacron: anacron startup succeeded
May 7 08:35:00 roadking anacron: anacron startup succeeded
May 7 08:44:15 roadking anacron: anacron startup succeeded
May 7 20:55:48 roadking anacron: anacron startup succeeded
May 7 21:06:05 roadking anacron: anacron startup succeeded
May 7 21:06:14 roadking anacron: anacron startup succeeded
[root@roadking root]#
[root@roadking log]# cat /var/log/cron | grep anacron
May 4 04:22:00 roadking anacron[25592]: Updated timestamp for job `cron.weekly' to 2003-05-04
May 5 04:02:10 roadking anacron[4751]: Updated timestamp for job `cron.daily' to 2003-05-05
May 6 04:02:04 roadking anacron[7107]: Updated timestamp for job `cron.daily' to 2003-05-06
May 6 16:25:21 roadking anacron[2024]: Anacron 2.3 started on 2003-05-06
May 6 16:25:22 roadking anacron[2024]: Normal exit (0 jobs run)
May 7 04:02:03 roadking anacron[2879]: Updated timestamp for job `cron.daily' to 2003-05-07
May 7 08:35:00 roadking anacron[4319]: Anacron 2.3 started on 2003-05-07
May 7 08:35:00 roadking anacron[4319]: Normal exit (0 jobs run)
May 7 08:44:15 roadking anacron[4542]: Anacron 2.3 started on 2003-05-07
May 7 08:44:15 roadking anacron[4542]: Normal exit (0 jobs run)
May 7 20:55:48 roadking anacron[6052]: Anacron 2.3 started on 2003-05-07
May 7 20:55:48 roadking anacron[6052]: Normal exit (0 jobs run)
May 7 21:06:05 roadking anacron[6307]: Anacron 2.3 started on 2003-05-07
May 7 21:06:05 roadking anacron[6307]: Normal exit (0 jobs run)
May 7 21:06:14 roadking anacron[6320]: Anacron 2.3 started on 2003-05-07
May 7 21:06:14 roadking anacron[6320]: Normal exit (0 jobs run)
May 8 04:02:07 roadking anacron[6844]: Updated timestamp for job `cron.daily' to 2003-05-08
[root@roadking log]#
[root@roadking log]# ll /var/spool/anacron/
total 12
-rw------- 1 root root 9 May 8 04:02 cron.daily
-rw------- 1 root root 9 May 1 04:42 cron.monthly
-rw------- 1 root root 9 May 4 04:22 cron.weekly
[root@roadking log]#
[root@roadking log]# cd /etc/cron.daily/
[root@roadking cron.daily]# ll
total 28
lrwxrwxrwx 1 root root 28 Apr 14 16:32 00-logwatch -> ../log.d/scripts/logwatch.pl
-rwxr-xr-x 1 root root 135 Jan 25 20:09 00webalizer
-rwxr-xr-x 1 root root 276 Jan 24 14:26 0anacron
-rwxr-xr-x 1 root root 51 Jan 24 13:09 logrotate
-rwxr-xr-x 1 root root 418 Feb 10 08:20 makewhatis.cron
-rwxr-xr-x 1 root root 104 Feb 27 14:24 rpm
-rwxr-xr-x 1 root root 132 Feb 19 11:50 slocate.cron
-rwxr-xr-x 1 root root 193 Feb 10 13:09 tmpwatch
[root@roadking cron.daily]# mv 00-logwatch 1-logwatch
[root@roadking cron.daily]# mv 00webalizer 1webalizer
[root@roadking cron.daily]# anacron -dn
Anacron 2.3 started on 2003-05-08
Normal exit (0 jobs run)
[root@roadking cron.daily]#
so, although I have the latest installed, and it doesn't appear to have changed....something is hosed somewhere. I appreciate your help ;-) anything else you can suggest before I write the author?
so, although I have the latest installed, and it doesn't appear to have changed....something is hosed somewhere.
Damn, you actually verified stuff, kewl :-]
"(..)Next move /etc/cron.daily/00{-logwatch,webalizer} to have a higher number, 0anacron should always be run first.
Next try to run anacron with the "-d" option to watch it post info to the screen (and also to the logfile), and add "-n" to force anacron to run the jobs regardless of the delay.
If anacron doesn't die then, you should try and retrace your steps regarding to changing configs or upgrading/installing stuff that (this) anacron (version) depends on."
I'm hoping to resurect some interest in this thread! I've noticed in the log files of SEVERAL folks posting about a particular subsytem being locked, that the message I'm referring to is present on all their systems also. doesn't anyone have a functional anacron? I wrote the author of anacron, and his response was:
On Tuesday 13 May 2003 15:06, you wrote:
> hello. hope this isn't a bother, but I've run into an anacron issue I just
> can't seem to crack. I've run through the expertise at linuxquestions.org,
> and haven't made much progress. if you have a moment, I would be grateful
> if you would advise me as to what a good next step would be. my issue is
> documented here:
> http://www.linuxquestions.org/questi...tid=299946#pos
>t299946
>
> I am very grateful for any assistance, or redirection you are able to
> provide.
most peculiar. anacron is quite simple. It figures out what needs to be run
and then runs it. Not much more than a smart, non interactive shell.
I am not familiar with RedHat's setup with "subsys locked". If you can run
anacron by hand and nothing looks odd (which you seem to be able to do)
perhaps the issue lies in whatever code handles the subsys locking?
I'm having the exact same problem, so I'm interested to see how this thread ends
I've verified everything listed here....I'm not as experienced with unix as you two, but I fake it well..lol
my anacron version is 2.3-17
running RedHat 7.3 / Plesk 5.0.4-rh7.3
If I run anacron -dn it appears to run....
It showed it ran cron.daily, yet none of the scripts in /etc/cron.daily ran.
/var/spool/anacron/cron.daily was updated, so next run showed
Normal exit (0 jobs run)
...anyway, I'm trying to use this to run some backup rotation scripts and it looked like being able to simply place them in these directories would be the easiest route....maybe not. lol
AFAIK anacron will be run on only two events: service start on boot up and from the /etc/cron.*/0anacron entries. When a box is booted it will run anacron to see if any jobs need to be run wrt the anacrontab, and then it exits, I mean it doesn't stay daemonized, so "status" reports anacron as dead, because it doesn't leave a PID file in /var/run. The /etc/cron.*/0anacron entries are run from crond and only serve to update the timestamp (option -u).
If anacron does not continue to run as a service,
then should there be an entry to run anacron in the standard crontab?
i.e. should crontab -l show an entry to run it ?
if so, I guess once daily with the -d option ? anacron -d
I not sure I'm understanding this...what's the point of anacron
even loading at boot if that's the only time it's going to run...then exit ? The point is for it to continue to run scheduled jobs, right?
The ability for anacron to run all scripts in a directory...is this something that cron can do ?
If so, could this setup be done with those same --run-parts entries in the standard crontab ?
the cron daemon runs jobs only if they are scheduled when crond is running. If a system is turned off overnight when not in use, the default daily, weekly, and monthly jobs scheduled in /etc/crontab during the system downtime will be missed.
The default system cron tasks are scheduled to run between 4 and 5 am. These jobs rotate logfiles, update quickly searchable databases of system files, clean up temporary file, etc. anacron solves the problem of missing these important cron jobs by running them at boot time if configured to do so in /etc/anacrontab.
in other words, if you leave your system on, and crond is running, you are safe to ingnore anacron.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.