public inbox for gentoo-server@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-server] cron: test -x /usr/sbin/run-crons && /usr/sbin/run-crons
@ 2005-09-28 14:20 Alex Efros
  2005-09-28 16:25 ` Ian P. Christian
  2005-09-28 20:28 ` Dark
  0 siblings, 2 replies; 4+ messages in thread
From: Alex Efros @ 2005-09-28 14:20 UTC (permalink / raw
  To: gentoo-server

Hi!

On all my servers I receive from time to time (usually once in 5-30 days)
email with subject subj :) and content:
---cut---
find: /var/spool/cron/lastrun/cron.hourly: No such file or directory
---cut---

I suppose this is because of race condition somethere in /usr/sbin/run-crons.
Root's default crontab is:
---cut---
*/15 * * * *     test -x /usr/sbin/run-crons && /usr/sbin/run-crons
0  *   * * *     rm -f /var/spool/cron/lastrun/cron.hourly
0  8   * * *     rm -f /var/spool/cron/lastrun/cron.daily
15 11  * * 6     rm -f /var/spool/cron/lastrun/cron.weekly
30 12  1 * *     rm -f /var/spool/cron/lastrun/cron.monthly
---cut---
and I think if first two lines from crontab will start at same time and
/usr/sbin/run-crons will check for existence of lastrun/cron.hourly
__BEFORE__ rm will remove it then race condition happens and result in
that email sent to root.

Can anybody confirm this?

If I'm right, then maybe better to change last 4 lines in crontab to not
run in %15 minute:
---cut---
*/15 * * * *     test -x /usr/sbin/run-crons && /usr/sbin/run-crons
5  *   * * *     rm -f /var/spool/cron/lastrun/cron.hourly
5  8   * * *     rm -f /var/spool/cron/lastrun/cron.daily
20 11  * * 6     rm -f /var/spool/cron/lastrun/cron.weekly
35 12  1 * *     rm -f /var/spool/cron/lastrun/cron.monthly
---cut---

-- 
			WBR, Alex.
-- 
gentoo-server@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-server] cron: test -x /usr/sbin/run-crons && /usr/sbin/run-crons
  2005-09-28 14:20 [gentoo-server] cron: test -x /usr/sbin/run-crons && /usr/sbin/run-crons Alex Efros
@ 2005-09-28 16:25 ` Ian P. Christian
  2005-09-28 16:32   ` Brett Curtis
  2005-09-28 20:28 ` Dark
  1 sibling, 1 reply; 4+ messages in thread
From: Ian P. Christian @ 2005-09-28 16:25 UTC (permalink / raw
  To: gentoo-server; +Cc: Alex Efros

[-- Attachment #1: Type: text/plain, Size: 179 bytes --]

On Wednesday 28 September 2005 15:20, Alex Efros wrote:
> Can anybody confirm this?

I can confirm the issue - but not the fix.

-- 
Ian P. Christian ~ http://pookey.co.uk

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-server] cron: test -x /usr/sbin/run-crons && /usr/sbin/run-crons
  2005-09-28 16:25 ` Ian P. Christian
@ 2005-09-28 16:32   ` Brett Curtis
  0 siblings, 0 replies; 4+ messages in thread
From: Brett Curtis @ 2005-09-28 16:32 UTC (permalink / raw
  To: gentoo-server; +Cc: Alex Efros

So can I. It has never cause any issues so I chose to ignore it.
On Sep 28, 2005, at 12:25 PM, Ian P. Christian wrote:

> On Wednesday 28 September 2005 15:20, Alex Efros wrote:
>
>> Can anybody confirm this?
>>
>
> I can confirm the issue - but not the fix.
>
> -- 
> Ian P. Christian ~ http://pookey.co.uk
>

-- 
gentoo-server@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [gentoo-server] cron: test -x /usr/sbin/run-crons && /usr/sbin/run-crons
  2005-09-28 14:20 [gentoo-server] cron: test -x /usr/sbin/run-crons && /usr/sbin/run-crons Alex Efros
  2005-09-28 16:25 ` Ian P. Christian
@ 2005-09-28 20:28 ` Dark
  1 sibling, 0 replies; 4+ messages in thread
From: Dark @ 2005-09-28 20:28 UTC (permalink / raw
  To: gentoo-server

Hello,

I can confirm it - I rarely open them, because my mailprogram will run 
out of resources.
One difference though, I get them once every 24 hour (around midnight).

So I just figured that it was because I had done something bad with my 
system :-)

My crontab as it is now:
--- begin
# Global variables
SHELL=/bin/bash
PATH=/sbin:/bin:/usr/sbin:/usr/bin
MAILTO=root
HOME=/

# check scripts in cron.hourly, cron.daily, cron.weekly and cron.monthly
0  *  * * *             rm -f /var/spool/cron/lastrun/cron.hourly
1  3  * * *             rm -f /var/spool/cron/lastrun/cron.daily
15 4  * * 6             rm -f /var/spool/cron/lastrun/cron.weekly
30 5  1 * *             rm -f /var/spool/cron/lastrun/cron.monthly
*/10  *  * * *          test -x /usr/sbin/run-crons && /usr/sbin/run-crons
0  0  * * *             /usr/sbin/logwatch.pl >/dev/null 2>&1
0  0  * * *             /etc/init.d/ntp-client restart >/dev/null 2>&1
--- end

And I know those two last lines look might weird, I've been too lazy to 
change them.. They work.

/Jakob Rosenlund



Alex Efros wrote:

>Hi!
>
>On all my servers I receive from time to time (usually once in 5-30 days)
>email with subject subj :) and content:
>---cut---
>find: /var/spool/cron/lastrun/cron.hourly: No such file or directory
>---cut---
>
>I suppose this is because of race condition somethere in /usr/sbin/run-crons.
>Root's default crontab is:
>---cut---
>*/15 * * * *     test -x /usr/sbin/run-crons && /usr/sbin/run-crons
>0  *   * * *     rm -f /var/spool/cron/lastrun/cron.hourly
>0  8   * * *     rm -f /var/spool/cron/lastrun/cron.daily
>15 11  * * 6     rm -f /var/spool/cron/lastrun/cron.weekly
>30 12  1 * *     rm -f /var/spool/cron/lastrun/cron.monthly
>---cut---
>and I think if first two lines from crontab will start at same time and
>/usr/sbin/run-crons will check for existence of lastrun/cron.hourly
>__BEFORE__ rm will remove it then race condition happens and result in
>that email sent to root.
>
>Can anybody confirm this?
>
>If I'm right, then maybe better to change last 4 lines in crontab to not
>run in %15 minute:
>---cut---
>*/15 * * * *     test -x /usr/sbin/run-crons && /usr/sbin/run-crons
>5  *   * * *     rm -f /var/spool/cron/lastrun/cron.hourly
>5  8   * * *     rm -f /var/spool/cron/lastrun/cron.daily
>20 11  * * 6     rm -f /var/spool/cron/lastrun/cron.weekly
>35 12  1 * *     rm -f /var/spool/cron/lastrun/cron.monthly
>---cut---
>
>  
>

-- 
gentoo-server@gentoo.org mailing list



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-09-28 20:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-28 14:20 [gentoo-server] cron: test -x /usr/sbin/run-crons && /usr/sbin/run-crons Alex Efros
2005-09-28 16:25 ` Ian P. Christian
2005-09-28 16:32   ` Brett Curtis
2005-09-28 20:28 ` Dark

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox