race in cron

matt at ucla-cs.UUCP matt at ucla-cs.UUCP
Wed Oct 24 11:28:52 AEST 1984


#endif lineeater

One could `touch' the new copy of crontab, to force cron to re-read the
crontab.  Or one could edit a scratch copy of crontab (in the same 
filesystem), then `mv scratch /usr/lib/crontab', which will prevent 
this race from occuring (since only links and unlinks are involved in 
the `mv').

A different fix than the one suggested would be to sleep for a few seconds 
after detecting the changed crontab.  This would give the editor time to 
write the file (except on floppy-based systems :-) ), and is even simpler
than a stat.

					- Matt
					  (Dept. of Old Crons)
-------
UUCP:	{ucbvax,ihnp4,randvax,trwrb!trwspp,ism780}!ucla-cs!matt
ARPA:	matt at ucla-locus



More information about the Comp.unix.wizards mailing list