LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 05-07-2003, 09:45 AM   #1
adenardo
Member
 
Registered: Oct 2001
Location: Fort Collins, Colorado
Distribution: RHEL3/FedoraCore3
Posts: 61

Rep: Reputation: 15
anacron dead but subsys locked


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?
 
Old 05-07-2003, 05:42 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
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).
 
1 members found this post helpful.
Old 05-07-2003, 10:12 PM   #3
adenardo
Member
 
Registered: Oct 2001
Location: Fort Collins, Colorado
Distribution: RHEL3/FedoraCore3
Posts: 61

Original Poster
Rep: Reputation: 15
well, stopping it did remove the lock in /var/lock/subsys. restarted it and got the same "dead but subsys locked" message. here is some more info:

[root@roadking root]# ll /etc/anacrontab
-rw-r--r-- 1 root root 317 Jan 24 14:26 /etc/anacrontab
[root@roadking root]#
[root@roadking root]#
[root@roadking root]#
[root@roadking root]#
[root@roadking root]# cat /etc/anacrontab
# /etc/anacrontab: configuration file for anacron

# See anacron(8) and anacrontab(5) for details.

SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin

1 65 cron.daily run-parts /etc/cron.daily
7 70 cron.weekly run-parts /etc/cron.weekly
30 75 cron.monthly run-parts /etc/cron.monthly
[root@roadking root]#
[root@roadking root]#
[root@roadking root]#
[root@roadking root]#
[root@roadking root]#
[root@roadking root]# ll /etc/cron.*
/etc/cron.d:
total 0

/etc/cron.daily:
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

/etc/cron.hourly:
total 0

/etc/cron.monthly:
total 4
-rwxr-xr-x 1 root root 278 Jan 24 14:26 0anacron

/etc/cron.weekly:
total 8
-rwxr-xr-x 1 root root 277 Jan 24 14:26 0anacron
-rwxr-xr-x 1 root root 414 Feb 10 08:20 makewhatis.cron
[root@roadking root]#
[root@roadking root]# crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.6291 installed on Wed May 7 21:05:07 2003)
# (Cron version -- $Id: crontab.c,v 2.13 1994/01/17 03:20:37 vixie Exp $)
0 0 * * * mount /backup
0 3 * * * umount /backup
5 0 * * * /root/simplebashbu.sh
[root@roadking root]#

should I reinstall anacron??
 
Old 05-08-2003, 07:15 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
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?
 
1 members found this post helpful.
Old 05-08-2003, 10:42 AM   #5
adenardo
Member
 
Registered: Oct 2001
Location: Fort Collins, Colorado
Distribution: RHEL3/FedoraCore3
Posts: 61

Original Poster
Rep: Reputation: 15
[root@roadking root]# anacron -V
Anacron 2.3
Copyright (C) 1998 Itai Tzur <itzur@actcom.co.il>
Copyright (C) 1999 Sean 'Shaleh' Perry <shaleh@debian.org>

Mail comments, suggestions and bug reports to <shaleh@debian.org>.

[root@roadking root]#

[root@roadking root]# rpm -qa | grep anacron
anacron-2.3-25
[root@roadking root]#
[root@roadking root]# rpm -V anacron
[root@roadking root]#
[root@roadking root]# rpm -V anacron-2.3-25
[root@roadking root]#

[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]# cat /var/spool/anacron/cron.*
20030508
20030501
20030504
[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?
 
Old 05-08-2003, 12:29 PM   #6
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
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."

Any results on that?
 
Old 05-09-2003, 10:18 AM   #7
adenardo
Member
 
Registered: Oct 2001
Location: Fort Collins, Colorado
Distribution: RHEL3/FedoraCore3
Posts: 61

Original Poster
Rep: Reputation: 15
I did that stuff, and copied the stdout. here it is again.

[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]#

following this, service --status-all still shows anacron dead but subsys locked. ;-(
 
Old 06-09-2003, 05:30 PM   #8
adenardo
Member
 
Registered: Oct 2001
Location: Fort Collins, Colorado
Distribution: RHEL3/FedoraCore3
Posts: 61

Original Poster
Rep: Reputation: 15
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?
 
Old 06-12-2003, 02:12 AM   #9
becoded
LQ Newbie
 
Registered: Jun 2003
Posts: 2

Rep: Reputation: 0
same problem here

Hey,

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

I'll keep watching.....
 
Old 06-12-2003, 03:49 AM   #10
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594Reputation: 3594
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).
 
Old 06-12-2003, 07:01 AM   #11
becoded
LQ Newbie
 
Registered: Jun 2003
Posts: 2

Rep: Reputation: 0
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 ?

Sorry for my lack of experience here
 
Old 06-13-2003, 01:37 AM   #12
adenardo
Member
 
Registered: Oct 2001
Location: Fort Collins, Colorado
Distribution: RHEL3/FedoraCore3
Posts: 61

Original Poster
Rep: Reputation: 15
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.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP : <<< mysqld dead but subsys locked >>> Fr33B5D Linux - Software 13 07-22-2010 01:35 PM
sshd dead but subsys locked phyrko Linux - Networking 9 03-26-2009 05:17 AM
radiusd dead but subsys locked velocitygirl Linux - General 5 10-27-2005 09:40 AM
sshd dead but subsys locked itsjustme Linux - Networking 14 09-08-2005 10:36 PM
crond dead but subsys locked dpirvulescu Linux - Software 9 04-23-2005 09:09 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration