Issue #2521 has been updated by Kjetil Torgrim Homme.
After looking at the source code to cronie (the new name for vixie-cron), I
think there is something missing in the analysis.
First, a temporary filename foo.xxx will not be ignored directly, it will log
that it is skipped due to the user not existing. To avoid this, use a
temporary filename starting with "." or ending with "~" (see not_a_crontab in
database.c)
Furthermore, mtime is remembered for each user's crontab, so even if cron
processed foo.xxx, it would not update the mtime remembered for the last
version of "foo".
I haven't experienced Volcane's problem myself, but my theory is that the
problem only surfaces when multiple crontabs are added in the same second.
cron may read the first version, but due to lack of precision, it will not know
that the second change with same mtime warrants reading the file afresh. If
this is the case, Puppet should batch up changes and write them all at once, or
possibly simpler, Puppet should sleep a little between crontab updates.
The best solution would be to use the published API, ie. write to a temporary
file and use crontab(1) to install it. On Solaris, cron(1m) does *not* poll
for changes to directories, but crontab(1) sends a notification over a FIFO to
the daemon that it should reread crontabs. (Is there Puppet code to handle
this today?) I guess that is hard to integrate into ParsedFile, though.
----------------------------------------
Bug #2521: file{} should update all timestamps when renaming files from temp
file.
http://projects.puppetlabs.com/issues/2521
Author: R.I. Pienaar aka Volcane
Status: Accepted
Priority: Normal
Assigned to:
Category: file
Target version: 0.25.6
Affected version: 0.24.8
Keywords:
Branch:
At present puppet writes new files made with the file resource type using a
temp file then renames the temp file. Ruby rename only updates change time not
mtime.
This is a problem when interacting with daemons that monitor directories for
new files, like /etc/cron.d:
1) puppet creates /etc/cron.d/foo.zxxx
2) crond checks for new files matching its rules, the temp file does not match
does not get noticed, crond saves last checked timestamp
3) puppet renames /etc/cron.d/foo.zxxx -> /etc/cron.d/foo and only ctime gets
updated not mtime
4) crond checks for new files since last check, finds none.
I think puppet should probably touch both mtime and ctime after renaming a file.
--
You have received this notification because you have either subscribed to it,
or are involved in it.
To change your notification preferences, please click here:
http://projects.puppetlabs.com/my/account
--
You received this message because you are subscribed to the Google Groups
"Puppet Bugs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/puppet-bugs?hl=en.