View previous topic :: View next topic |
Author |
Message |
Mugen096 n00b
Joined: 16 Aug 2004 Posts: 15
|
Posted: Thu Nov 04, 2004 3:21 am Post subject: Cron Scheduler is acting strange... |
|
|
Ok guys, here is one for you. I have a old 486 running Gentoo at home. Provides simple functions, as well as some nice gateway functions. Having a problem with VIXIE-CRON. I have it set up in the crontab to run a emerge sync on a weekly schedule...this then feeds all of my other servers internally, so I only do one sync on my network. Problem I am noticing, cron is running the schedule up to a day off and some change of when I am scheduling it...but it is also running it on the schedule that I set. It seems to be getting progressivly worse. Like the hardware clock on the 486 is really off, and the software clock, that sync's once a day in cron, is right on.
I guess is there a way to fix it so that CRON is getting its times from the software clock, instead of reading the clock signals from the motherboard? Or, is there a way to sync the hardware clock at the same time, or 5 minutes after, that I sync the software clock? Any help would be appreciated, I would like to get this back down to just running once a week on SYNC...don't want to saturate the network for other users...any help would be appreciated.
Thanx guys...
Dan |
|
Back to top |
|
|
suso Tux's lil' helper
Joined: 08 Apr 2004 Posts: 137 Location: Bloomington, IN
|
Posted: Wed Nov 10, 2004 4:59 pm Post subject: |
|
|
Vixie Cron is kinda weird, I don't think it uses the hardware clock though. I'm wondering if perhaps you have upgraded glibc recently without rebooting your system or restarting cron? I always restart after upgrading glibc. So much depends on it that if you don't restart some of the running services will end up behaving strangely. I've had this happen to me on a server with cron aftering upgrading glibc.
As far as fixing the time degration problem though, you should use ntp to sync your software clock with an ntp server if you can and then run this to sync your hardware clock:
Quote: | DATE=`date +"%m/%d/%y %H:%M:%S"` hwclock --set --date="$DATE" |
I tried using the backticks directly after the --date option, but it didn't work right for some strange reason.
You can put that command line in your crontab and run it once a day or something. _________________ Use saferdomainsearch.com to safely search for domain availability. |
|
Back to top |
|
|
Mugen096 n00b
Joined: 16 Aug 2004 Posts: 15
|
Posted: Mon Nov 22, 2004 3:17 am Post subject: |
|
|
I think you migth be on the right track. I have done a couple of updates to this system. Running on a old 486 DX4, at a killer 100 MHz. Runs DNS for the house. But I have updated the Glibc, at least once, but possibly twice. I have restarted cron, repeatedly....but that doesn't seem to help it. Will just have to break down and restart....bummer, was loving the uptime on the box...150 days and counting....
Also, maybe you know something about logrotate. Could be related to the first problem, might not. I can run logrotate just fine and it will rotate all of my logs...which I have broke out of messages...such as logs for my routers, printers, apache, bind....and others. All of those get rotated, but when I broke out cron messages into seperate files, and it goes to rotate those. I don't get any error messages, but cron shuts down and doesn't come back up until I manually start it. Any thoughts on that one?
Dan
If I can remember correctly, this was before I upgraded the glibc...or anything else.... |
|
Back to top |
|
|
suso Tux's lil' helper
Joined: 08 Apr 2004 Posts: 137 Location: Bloomington, IN
|
Posted: Mon Nov 22, 2004 3:35 am Post subject: |
|
|
Hmmm, I'm not sure that you have to restart cron after rotating its logs or not. I looked on one of my older RedHat machines that runs vixie-cron and it had this in /etc/logrotate.d/syslog:
Code: | /var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}
|
So maybe its just a matter of rotating them and restarting syslogd. Some daemons don't keep a filehandle open on their logfile and thus you don't have to restart it when you rotate the log. You can check by running:
Code: | lsof | grep -i cron |
Running that on my redhat machine reveals that syslog actually the program that keep /var/log/cron open. So there you go, there is no need to restart cron.
This was a one beer problem. _________________ Use saferdomainsearch.com to safely search for domain availability. |
|
Back to top |
|
|
Mugen096 n00b
Joined: 16 Aug 2004 Posts: 15
|
Posted: Mon Nov 22, 2004 11:45 pm Post subject: |
|
|
Well, my problem isn't that I have to restart CRON....so much as it dies when the logs for it are rotated, and then I have to manually start it again...otherwise my system stays up and running, with out CRON in the process list... I will have to take a look into that tonight, when I get home from work, but I see what you mean....probably going to have to investigate this one just a little bit further....now, if I could just get my installation of OpenXchange to work......ldap problems...
Dan |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|