LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 12-20-2007, 01:43 AM   #1
hb950322
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Rep: Reputation: 15
Cool Possible Bug in Slackware 12 cron-handling ?


I have set up a straightforward backup-script in a Slackware 12 server and put this in /etc/cron.daily where it is performed every day at 4:46 a.m. I changed absolutely nothing from the Slackware standard installation.

The script works fine from the command-line, when finished I get a mail to my workstation .

The scripts in cron.daily are executed from the script /usr/bin/run-parts (written by P.V. himself), as to be seen by the 'crontab -l' command.

The backup script is definitely executed twice by crond, because I get two mails in the morning and errors occur, because a mobile disc is mounted at the start of the script and unmounted when finished. Both mails have the same timestamp (HH:MM), but must be executed just some (milli)seconds behind each other.

I can't figure out, why this is the case. Has anyone else made similar experience and figured out an solution ?

Greets
Henric
 
Old 12-20-2007, 02:51 AM   #2
ledow
Member
 
Registered: Apr 2005
Location: UK
Distribution: Slackware 13.0
Posts: 241

Rep: Reputation: 34
Not heard of that before. Are you sure the script doesn't do something stupid at the end? What happens if you login as root and just run the script directly (make sure you actually run the one that's in the cron folder?

You've not done things like put a symlink in there as well, or used a two-part script?

Additionally, check that you haven't played with root's crontab, or your particular users for that matter, because they are seen as seperate things and they might both be trying to do the runparts thing. There haven't been any cron updates to Slackware 12 since release that I can see, so it may be worthwhile loading up another "clean" slackware install (do it in a virtual machine like qemu or something, it'll only need a couple of gigs of space and with kqemu it'll be just as fast as doing it for real on the same computer) and using the same script on there to see if it happens.
 
Old 12-20-2007, 03:54 AM   #3
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 5,194

Rep: Reputation: Disabled
Does your server's clock run too fast and is it's time set backwards regularly syncing it to a NTP server?
That could explain your issue - if the computer's time gets set back far enough just after the first job started, the job's scheduled start time may actually occur twice.

Eric
 
Old 12-20-2007, 06:38 AM   #4
ledow
Member
 
Registered: Apr 2005
Location: UK
Distribution: Slackware 13.0
Posts: 241

Rep: Reputation: 34
Running ntpd should counteract anything like that. However regular ntpdate's could cause that problem, yes, because it'll just correct the clock "all-at-one", but ntpd should be smart enough to adjust in tiny increments so that such "jumps" don't happen. Even then, it shouldn't be happening so regularly or on such a fine scale - I have ntpd on unreliable clocks and I've never had that problem. If it is that, though, and I'm wrong, it's probably better to make the script non-reentrant instead of turning ntpd off - a simple "have I run in the last minute" check should suffice.
 
Old 12-21-2007, 02:24 AM   #5
hb950322
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Original Poster
Rep: Reputation: 15
Talking No ntpd running

Thanks a lot for your efforts an hints.

First:

ntpd is not running, so from this side I don't see an influence for this issue.

Second:

The scripts works perfect from the command-line as root, executed with

/etc/cron.daily/backup

and there are no links or other stuff there. The script itself does no background-processing, which could cause some strange behaviour, it goes line by line.

Third:

No crontab at all has been manipulated, it's all basic install.


But: It is a Dual-Core SMP System. I have no knowledge if this can cause problems.

Over christmas I will set up the same system on a "normal" Athlon 3000 and put the same script in place. Let's see what comes up then ..

Greets
Henric
 
Old 12-21-2007, 11:49 AM   #6
regis_n_bits
Member
 
Registered: Mar 2006
Distribution: Slackware64 14.1 (kernel 3.13.5)
Posts: 83

Rep: Reputation: Disabled
The run-parts script will execute all script files found in the cron.daily directory. Is it possible that you have two copies of the same script in this directory? Or maybe even a backup copy of your script (i.e. a file ending in "~")?
 
Old 12-22-2007, 12:32 AM   #7
Alien_Hominid
Senior Member
 
Registered: Oct 2005
Location: Lithuania
Distribution: Hybrid
Posts: 2,247

Rep: Reputation: 53
And this is very possible if you edit files with kate.
 
Old 12-22-2007, 01:32 AM   #8
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,123

Rep: Reputation: 151Reputation: 151
I don't see that behaviour here, either. Can you please post the errors that you get and the script contents? Are you getting two copies of the backup or errors due to files already existing?
 
Old 12-23-2007, 02:38 AM   #9
hb950322
LQ Newbie
 
Registered: Dec 2006
Posts: 24

Original Poster
Rep: Reputation: 15
Smile No Backup copies

I've had backup copies there and also thought to get the reason. But this is not the case. run-parts does not execute this scripts, as you can see by reading the sourcecode. I removed them either.

As I explained before, the script works perfekt from command-line without errors.

I'm in the winter-holliday now for two weeks. I'll put this script directly in the crontab, without run-parts and remove it from cron.daily. We will see what happens.

Thanks a lot to all

Greets
Henric
 
  


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Mozilla to fix 9-month-old JAR URL handling bug LXer Syndicated Linux News 0 11-19-2007 11:40 PM
cron.allow and cron.deny in slackware? tl64 Slackware 5 10-13-2005 09:44 PM
x86 BUG handling RajRed Programming 0 04-27-2005 12:24 PM
cron bug? linux_terror Linux - Software 7 09-07-2004 11:38 AM
cron+vim bug treebeard Slackware 3 09-30-2002 10:03 AM


All times are GMT -5. The time now is 04:27 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration