Gentoo Archives: gentoo-dev

From: Alexander Rauth <Alexander.Rauth@××××××××××××.de>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] problems with '/usr/sbin/run-crons' on slow computers
Date: Thu, 01 Jul 2004 08:19:33
Message-Id: 1088669965.7538.8.camel@pro11.local.promotion-ie.de
1 -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<
2 mkdir -p /var/spool/cron/lastrun
3
4 # Make sure its not running multiple instances at once.
5 if test -f /var/spool/cron/lastrun/lock
6 then
7 cronpid=`cat /var/spool/cron/lastrun/lock`
8 if `kill -0 $cronpid >/dev/null 2>&1`
9 then
10 exit 0
11 fi
12 fi
13 -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<
14 the construction above won't work every time on my K6-200 ....
15 Once in two days it happens that the 'lock'-file is gone between the
16 'test -f ....' and 'cronpid=.....' and I receive following error
17 message:
18 -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<
19 cat: /var/spool/cron/lastrun/lock: No such file or directory
20 -----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<-----8<
21
22
23 if I replace
24 cronpid=`cat /var/spool/cron/lastrun/lock`
25 with
26 cronpid=`cat /var/spool/cron/lastrun/lock 2> /dev/null`
27 it solves my problem
28
29 My question is, if there is a nicer way to fix that....
30
31 Alexander
32
33
34 --
35 gentoo-dev@g.o mailing list

Replies

Subject Author
Re: [gentoo-dev] problems with '/usr/sbin/run-crons' on slow computers Drake Wyrm <wyrm@×××××.com>