Issue #2521 has been updated by R.I. Pienaar.

Kjetil Torgrim Homme wrote:
>
> we get a problem if the daemon filters files by comparing the file's mtime to 
> the directory's mtime.  this is a dubious practice, and it should keep more 
> state to work more reliably (e.g., remembering a timestamp for the last 
> processed file will solve the problem wrt. Puppet.  to handle rename(2)d 
> files in general, you need more state, perhaps the way cronie does it.)

how will remembering the last processed time help? consider this:

 * puppet writes a temp file
 * cron or whatever checks for files, remembers the timestamp
 * puppet renames the file now it will be included in crons checks for files 
thats new/changed
 * cron checks for files since timestamp and miss the file because the 
timestamp is earlier than before as rename doesnt change it


This is exactly where I recall the problem was but dont have the exact details, 
or version of cron it was or anything more useful.
----------------------------------------
Bug #2521: file{} should update all timestamps when renaming files from temp 
file.
https://projects.puppetlabs.com/issues/2521

Author: R.I. Pienaar
Status: Accepted
Priority: Normal
Assignee: 
Category: file
Target version: 
Affected Puppet 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.

Reply via email to