This is part of The Pile, a partial archive of some open source mailing lists and newsgroups.
To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: Cron strangeness Date: Mon, 28 Apr 2003 14:19:21 -0400 Last week, my Red Hat 8.0 system quit executing scheduled cron jobs. It had been running the jobs reliably for months prior, but just quit. The /var/log/cron file shows all the jobs being run as if nothing were wrong, but the jobs don't actually run, nor do they generate email to root as they had before. As a test, I created a simple script that sends a text file to root via email, and scheduled it to run every minute. The /var/log/cron file shows an entry for every minute, but no email was sent. Anybody know what's going on here? === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Mon, 28 Apr 2003 15:18:15 -0400 Roger [mailto:roger@efn.org] wrote: > have you tried running the jobs from the command line? Yes. All these jobs have run reliably, either by cron or from the command line, for months prior. === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Mon, 28 Apr 2003 15:25:27 -0400 Jeff McKeon [mailto:jsm@inpro.net] wrote: > Did you make any permissions changes on the jobs? There may have been, however cron executes them as root. Could permission changes cause this even though they are executed as root? === To: Redhat list <redhat-list@redhat.com> From: Peter Peltonen <peter.peltonen@fivetec.com> Subject: Re: Cron strangeness Date: 28 Apr 2003 22:34:41 +0300 Roger wrote: > >had before. As a test, I created a simple script that sends a text file to > >root via email, and scheduled it to run every minute. The /var/log/cron > >file shows an entry for every minute, but no email was sent. Is sendmail running? Can you send other email from the system normally? What else is the system trying to do than send an email? === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Mon, 28 Apr 2003 15:57:23 -0400 Info - Demerson [mailto:demerson@zaffari.com.br] wrote: > Maybe the cron has stopped... > try service anacron status I have rebooted the machine and looked at DMESG for any strangeness. Heres what happens when I try 'service anacron status': # service anacron status anacron dead but subsys locked === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Mon, 28 Apr 2003 15:58:55 -0400 Peter Peltonen [mailto:peter.peltonen@fivetec.com] wrote: > Is sendmail running? Can you send other email from the system normally? > What else is the system trying to do than send an email? I can run the script manually. It sends mail. The other scripts do data transfers via FTP from several different systems, and run SQL code to import into MYSQL. === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Peter Peltonen <peter.peltonen@fivetec.com> Subject: RE: Cron strangeness Date: 28 Apr 2003 23:20:17 +0300 Jim Moseby wrote: > I have rebooted the machine and looked at DMESG for any strangeness. Heres > what happens when I try 'service anacron status': > > # service anacron status > anacron dead but subsys locked It seems that your anacron has died abnormally. It keeps a lock file at /var/lock/subsys directory. A lock file is a file which the system can query to see if a process is alive (if the file exists -> process alive). Sometimes when process dies abnormally the lock file is not removed and you need to remove it by hand to get the process started again (the startup scripts usually query it to see if the process is already running). So do: root# rm /var/lock/subsys/anacron root# service anacron start === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Mon, 28 Apr 2003 16:28:11 -0400 Thanks. I did what you suggested, and the following occured: # service anacron status anacron dead but subsys locked # ls /var/lock/subsys/a* anacron apmd apache atd # rm -f /var/lock/subsys/anacron # service anacron start Starting anacron: [ OK ] # service anacron status anacron dead but subsys locked # ps ax |grep anacron # It says it started, but there is no anacron in the 'ps ax' list, and 'status' still says anacron is dead. Any ideas? Jim -----Original Message----- From: Peter Peltonen [mailto:peter.peltonen@fivetec.com] Sent: Monday, April 28, 2003 4:20 PM To: 'redhat-list@redhat.com' Subject: RE: Cron strangeness On Mon, 2003-04-28 at 22:57, Jim Moseby wrote: > I have rebooted the machine and looked at DMESG for any strangeness. Heres > what happens when I try 'service anacron status': > > # service anacron status > anacron dead but subsys locked It seems that your anacron has died abnormally. It keeps a lock file at /var/lock/subsys directory. A lock file is a file which the system can query to see if a process is alive (if the file exists -> process alive). Sometimes when process dies abnormally the lock file is not removed and you need to remove it by hand to get the process started again (the startup scripts usually query it to see if the process is already running). So do: root# rm /var/lock/subsys/anacron root# service anacron start === To: redhat-list@redhat.com From: tony@pfeiffer.edu via thanatos.pfeiffer.edu Subject: Re: Cron strangeness Date: Mon, 28 Apr 2003 17:03:33 -0400 (EDT) Peter mentioned sendmail below. Has anyone else noticed that somehwere in the last couple distro releases ie, 7.3, 8 and 9, that sendmail must be running all the time in order for cron jobs to be sent? In other words, I have to run chkconfig --list sendmail to make sure its starting on those servers, just so I can send nightly cron job results. If anyone knows of a better solution, that would be excellent. As far as the problem with cron jobs not sending, I think that's the answer -- fire up sendmail with its init script. my .02 anyway === To: redhat-list@redhat.com From: Andrew Williams <andrew.williams@sourcefire.com> Subject: Re: Cron strangeness Date: 28 Apr 2003 17:15:55 -0400 On Mon, 2003-04-28 at 17:03, Tony Inskeep wrote: > Peter mentioned sendmail below. Has anyone else noticed that somehwere in > the last couple distro releases ie, 7.3, 8 and 9, that sendmail must be > running all the time in order for cron jobs to be sent? > > In other words, I have to run > > chkconfig --list sendmail > > to make sure its starting on those servers, just so I can send nightly > cron job results. If anyone knows of a better solution, that would be > excellent. You can use Net::SMTP to send data sent over STDIN to someone via a specified mailserver. Should be a quick 5 or 6 liner. === To: redhat-list@redhat.com From: Robert Jones <kerplop@ectisp.net> Subject: Re: Cron strangeness Date: Mon, 28 Apr 2003 17:42:58 -0500 As I read through several responses to this question, I started wondering how the discussion turned to ANACRON. Referring to the original post (below) I still don't know how anacron became involved. On Monday 28 April 2003 02:37 pm, redhat-list-request@redhat.com wrote: > From: Jim Moseby <JMoseby@nrbindustries.com> > To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> > Subject: Cron strangeness > Date: Mon, 28 Apr 2003 14:19:21 -0400 > Reply-To: redhat-list@redhat.com > > > Last week, my Red Hat 8.0 system quit executing scheduled cron jobs. > It had been running the jobs reliably for months prior, but just > quit. The /var/log/cron file shows all the jobs being run as if > nothing were wrong, but the jobs don't actually run, nor do they > generate email to root as they had before. As a test, I created a > simple script that sends a text file to root via email, and scheduled > it to run every minute. The /var/log/cron file shows an entry for > every minute, but no email was sent. Frankly, I don't know what's going on with cron but if I look at anacron, I get the same result as someone noted: [rj@blackhole nsmail]$ /sbin/service anacron status anacron dead but subsys locked ...and my cron jobs are executing as they should. Maybe the OP should try checking the cron daemon [rj@blackhole nsmail]$ /sbin/service crond status crond (pid 2093) is running... ...restarting that baby if nothing else works. === To: "'Robert Jones '" <kerplop@ectisp.net>, From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Mon, 28 Apr 2003 23:05:31 -0400 Interestingly, a previous poster, whom I had assumed didn't get the gist of the problem, asked "Is sendmail started?" It wasn't. But I didn't think that had anything to do with the problem - cron jobs not executing. I started sendmail, and all of a sudden, cron jobs are working again. :o/ Now that the immediate problem is fixed, the questions become 1. "Why does cron require sendmail to be running?" 2. "If cron does require sendmail, why doesn't it complain if it's not running?" 3. "If cron does not require sendmail, why did starting sendmail fix this problem? Hmmmmmmm Now I'm going to go RTFM and see if it says anything about requiring sendmail. Thanks to all who replied, especially the one who asked if sendmail was started. :o) === To: redhat-list@redhat.com From: Bret Hughes <bhughes@elevating.com> Subject: RE: Cron strangeness Date: Mon, 28 Apr 2003 23:15:10 -0500 On Mon, 2003-04-28 at 22:05, Jim Moseby wrote: > Interestingly, a previous poster, whom I had assumed didn't get the gist of > the problem, asked "Is sendmail started?" It wasn't. But I didn't think > that had anything to do with the problem - cron jobs not executing. > > I started sendmail, and all of a sudden, cron jobs are working again. :o/ > > Now that the immediate problem is fixed, the questions become > > 1. "Why does cron require sendmail to be running?" > 2. "If cron does require sendmail, why doesn't it complain if it's not > running?" > 3. "If cron does not require sendmail, why did starting sendmail fix this > problem? > > Hmmmmmmm > > Now I'm going to go RTFM and see if it says anything about requiring > sendmail. Thanks to all who replied, especially the one who asked if > sendmail was started. :o) > I think the jobs were running you just weren't getting the cron generated emails. Did you get all the old ones too? === To: redhat-list@redhat.com From: Beast <beast@setuid.com> Subject: Re: Cron strangeness Date: Tue, 29 Apr 2003 12:18:52 +0700 Tuesday, April 29, 2003, 10:05:31 AM, Jim wrote: > Interestingly, a previous poster, whom I had assumed didn't get the gist of > the problem, asked "Is sendmail started?" It wasn't. But I didn't think > that had anything to do with the problem - cron jobs not executing. > I started sendmail, and all of a sudden, cron jobs are working again. :o/ > Now that the immediate problem is fixed, the questions become > 1. "Why does cron require sendmail to be running?" not cron, but your job. > 2. "If cron does require sendmail, why doesn't it complain if it's not > running?" cron doesn't know anything about jobs. cron doesn't know that your job is require sendmail to run. > 3. "If cron does not require sendmail, why did starting sendmail fix this > problem? === To: redhat-list@redhat.com From: "Mike Vanecek" <rh_list@mm-vanecek.cc> Subject: RE: Cron strangeness Date: Tue, 29 Apr 2003 00:33:29 -0600 Jim Moseby <JMoseby@nrbindustries.com> wrote: > Yes. All these jobs have run reliably, either by cron or from the command > line, for months prior. Could it be that cron starts and then abends due to an error in one of the cron scripts? Maybe you should try running each of the cron scripts from the command line and see if any of them crash. Any changes made to /etc/crontab that could have inserted an error which causes cron to stop. That they have run reliably for months is not material; something is causing them not to run. Process your cron configuration manually as though you were the system. As you walk through, something should not be working correctly. For example, one of the first things that cron does is run anacron. If that is abending, could it be that error stops any further processing by cron? === To: redhat-list@redhat.com From: Ritesh Raj Sarraf <rrs_rhlist@softhome.net> Subject: Re: Cron strangeness Date: 29 Apr 2003 12:45:37 +0530 On Mon, 2003-04-28 at 23:49, Jim Moseby wrote: > Last week, my Red Hat 8.0 system quit executing scheduled cron jobs. It had > been running the jobs reliably for months prior, but just quit. The > /var/log/cron file shows all the jobs being run as if nothing were wrong, > but the jobs don't actually run, nor do they generate email to root as they > had before. As a test, I created a simple script that sends a text file to > root via email, and scheduled it to run every minute. The /var/log/cron > file shows an entry for every minute, but no email was sent. > > Anybody know what's going on here? is sendmail running on the localport 127.0.0.1 if not enable it. === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Tue, 29 Apr 2003 07:58:40 -0400 Mike - Running the scripts manually is exactly what I have had to do since cron stopped working. They all run without error. === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Tue, 29 Apr 2003 08:01:19 -0400 Mr. Beast, None of my jobs require sendmail. Cron (by default) sends any output the jobs generate to root. The jobs not running was the problem, the missing mail was a side-effect. Thanks for playing... === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Tue, 29 Apr 2003 08:04:32 -0400 Nope. The jobs weren't running. This machine is a data warehouse. It gathers data from several disparate systems by way of these scripts, and each script keeps a log of its activitiy. They definately weren't running until I started sendmail yesterday. Thanks! JM PS - No, I didn't get any backlogged emails when I started sendmail. === To: "'redhat-list@redhat.com'" <redhat-list@redhat.com> From: Jim Moseby <JMoseby@nrbindustries.com> Subject: RE: Cron strangeness Date: Tue, 29 Apr 2003 08:22:25 -0400 A new twist - This morning I decided to stop sendmail and see if the cron jobs stop as well. They don't. Cron jobs execute fine now whether or not sendmail is started. (Just no email without sendmail) :o/ So, we fixed the problem yesterday some other way, and starting sendmail was a coincidence. Maybe stopping crond and anacron, deleting the corresponding /var/lock/ entries, and restarting them did the trick. (?) Anyway, problem solved, tragedy averted, thanks for yor time. === To: redhat-list@redhat.com From: Bret Hughes <bhughes@elevating.com> Subject: RE: Cron strangeness Date: 29 Apr 2003 08:40:37 -0500 On Tue, 2003-04-29 at 07:04, Jim Moseby wrote: > Nope. The jobs weren't running. This machine is a data warehouse. It > gathers data from several disparate systems by way of these scripts, and > each script keeps a log of its activitiy. They definately weren't running > until I started sendmail yesterday. > > Thanks! > > JM > > PS - No, I didn't get any backlogged emails when I started sendmail. > You know if you can replicate this, it is a good idea to file a bug report. I think I bumped into this helping my brother on a 8.0 system that was not sending cron related mail. I this case there were 50 or so mails that got sent once I started sendmail. ===