From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from lists.gentoo.org ([140.105.134.102] helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.62) (envelope-from ) id 1I75c2-0006Mm-Kh for garchives@archives.gentoo.org; Sat, 07 Jul 2007 08:25:55 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.14.0/8.14.0) with SMTP id l678OXxY022274; Sat, 7 Jul 2007 08:24:33 GMT Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by robin.gentoo.org (8.14.0/8.14.0) with ESMTP id l678LLlf017517 for ; Sat, 7 Jul 2007 08:21:21 GMT Received: from ip6-localhost (localhost [127.0.0.1]) by smtp.gentoo.org (Postfix) with ESMTP id ADB2564C5C; Sat, 7 Jul 2007 08:21:20 +0000 (UTC) From: Mike Frysinger Organization: wh0rd.org To: gentoo-dev@lists.gentoo.org Subject: Re: [gentoo-dev] Inotify and (f)crontabs Date: Sat, 7 Jul 2007 04:23:34 -0400 User-Agent: KMail/1.9.7 Cc: "Ryan Reich" References: <2bd962720707010748g6fcb96cfw47a85610aadc9f79@mail.gmail.com> In-Reply-To: <2bd962720707010748g6fcb96cfw47a85610aadc9f79@mail.gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart4452205.kDnqpcLAIY"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200707070423.35314.vapier@gentoo.org> X-Archives-Salt: fed570b7-d10b-4653-968d-068c02664274 X-Archives-Hash: 8a5e0d5d15c25e7912dd3f318bbf9b32 --nextPart4452205.kDnqpcLAIY Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Sunday 01 July 2007, Ryan Reich wrote: > This is a small essay on Gentoo's setup for fcron. which is troublesome because some of the things here are specific to fcron= =20 (which frankly dont interest me) while others are specific to the cronbase= =20 package which installs `run-crons` (which does interest me as it is a=20 Gentooism) ... i'll try to pick out only the relevant pieces as you said=20 yourself, the fcron things should go upstream. > 2. is implmented by putting the following rules in /etc/crontab: > 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 * * * * /usr/bin/test -x /usr/sbin/run-crons && > /usr/sbin/run-crons > whose effect is, at intevals of one hour, day, week, and month, to > remove some state files for the script run-crons, and also to run said > script every ten minutes. The purpose of run-crons is to run the > scripts in /etc/cron.{hourly,...} at the appropriate intervals, thus > saving me the effort of adding a lot of lines looking like > 1 3 * * * * some-command > to my crontab. you missed a critical aspect: offline time. the way run-crons is implement= ed,=20 if you happen to routinely shut your machine off at the time that the cronj= ob=20 is supposed to fire, then the standard you proposed will pretty much never= =20 fire. the run-crons implementation however has a pretty good guarantee tha= t=20 the periodic crons will get fired at the next uptime opportunity. > Criticism: > Both of these ideas are, in principle and in practice, inefficient and > irritating. > 1. Since I will only ever update my crontabs rarely, checking every > ten minutes is likely to yield a negative result virtually 100% of the > time; however, since one wants the system to respond quickly when a > change is made, it is necessary to check frequently. This would seem > to be a contradiction. > > 2. The problem is even worse: though it is conceivable that a real > cron demon would be updating his crontabs willy-nilly, and thus that 1 > is not actually inefficient for him, it is not possible, even in > principle, for 2 to be worthwhile. run-crons runs commands at > intervals of no less than one hour, but is itself run every ten > minutes.=20 these statements are incorrect as they are based on incorrect assumptions. = =20 the point of the 10 minute cycle is not to see if anything of the cron dirs= =20 have changed, but if any routine cronjob needs to fire (refer to my comment= =20 above). > Furthermore, the files /var/spool/cron/lastrun/cron.* are=20 > ALREADY handled in the run-crons script itself, so that most of the > above commands would seem to be redundant. this is most likely true. > This one also has the=20 > additional unpleasant property of filling the logs with useless > messages: > [fcron] Job /usr/bin/test -x /usr/sbin/run-crons && > /usr/sbin/run-crons started for user > systab yes, this sucks, but so it goes. > The reason that run-crons doesn't log is unclear to me. there probably isnt one; file a bug with a patch if you like or just file a= =20 bug. =2Dmike --nextPart4452205.kDnqpcLAIY Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4 (GNU/Linux) iQIVAwUARo9Nh0FjO5/oN/WBAQKhOBAAxa9WtBNwVohaI55zE2UFuxRgDFqSUGZL 6baGzPRxomu/mG23dQ12qfbAAef0+9v+lfoPpkmZNTrHgafhAHmPg1ywUAM5l1i/ MFazPCv0KzPyyCkdyle78ouMPm9eTjfxaxE1F8qet13mn3/MWF91dNBQU+Ae32VR XGSELA2B2EYvSC2T0OoPkd0ZoUMfFv1Yb/MwhblB2LBBsIUfauw4L5pVLmTpOyS5 qBaSvc9Q7x4nwjLqatCzoE+oPtwYHsOOj9//R86Z3cb6UT7x4DKk/f/wk2VuZ879 XDj07ySk9/A5AbvSPoAWSXEs1D4qeXubw+YOBLAMp5NBAt0wkky7Z+0TlOG4ydHx /GBady1JX+PIIIOZf6vVTeZKVnuGVS4mWvnqd7hUUwmjREX4+EWZz6qUsTVbDzt8 02nOYdQYLWj1crg3I/yR9TW1w0bycDD+u8bx4qGs4KAHBsJW04kg6hzrv6/UVC5P Bla0+dyKPBwSv/bU6F3PxACbQk8XJlJ0V1nZ9KXNgID93a4UssotPk6s231BtBWs 5a01+HVodcnh0lMjutqK+gRyR/xlr8ZGKVP9dv7URdmR62uGJ7lsWsrImCxOlvKO KxKncuyksNbFQLQkv7Hpqo6Try9+7P6F9nXSLuyeAn4z+lztFaoIr9TIfmgkZHXM pP7BZ7A74ts= =ICg6 -----END PGP SIGNATURE----- --nextPart4452205.kDnqpcLAIY-- -- gentoo-dev@gentoo.org mailing list