-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I''m trying to figure out why exec{} which subscribes to a file, doesn''t get triggered when the file is touched by puppet. I''ve got the following: exec { "/usr/sbin/postmap /etc/postfix/checks/access": refreshonly => true, subscribe => File["/etc/postfix/checks/access"]; "/usr/sbin/postmap /etc/postfix/checks/access_client": refreshonly => true, subscribe => File["/etc/postfix/checks/access_client"]; } file { "/etc/postfix/checks/access": source => "$fileserver/postfix/checks/access", mode=> 0600, owner => root, group => root; "/etc/postfix/checks/access_client": source => "$fileserver/postfix/checks/access_client", mode=> 0600, owner => root, group => root; } and although I am not changing the content of the source for the ''access'' and ''access_client'' files, it seems like puppet is touching them so their dates are recent, and yet the exec call isn''t being run when this happens. Preferably, I wouldn''t want postfix to touch these files, unless they are changed on the fileserver, but if it feels it needs to (for whatever reason), I would expect that it runs the exec{} that is subscribing to it. Am I missing something? Thanks, Micah -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGYfk/9n4qXRzy1ioRAlrRAJwL4svF+PCms4SPeFD8FS2ZIOd0tQCgtEG3 n4tBmKj/y3eKE+BdIrC8yW4=oB2W -----END PGP SIGNATURE-----
On Jun 2, 2007, at 6:11 PM, Micah Anderson wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Hi, > > I''m trying to figure out why exec{} which subscribes to a file, > doesn''t > get triggered when the file is touched by puppet. I''ve got the > following: > > exec { > "/usr/sbin/postmap /etc/postfix/checks/access": > refreshonly => true, > subscribe => File["/etc/postfix/checks/access"]; > > "/usr/sbin/postmap /etc/postfix/checks/access_client": > refreshonly => true, > subscribe => File["/etc/postfix/checks/access_client"]; > } > > file { > "/etc/postfix/checks/access": > source => "$fileserver/postfix/checks/access", > mode=> 0600, owner => root, group => root; > > "/etc/postfix/checks/access_client": > source => "$fileserver/postfix/checks/access_client", > mode=> 0600, owner => root, group => root; > }This looks correct.> and although I am not changing the content of the source for the > ''access'' and ''access_client'' files, it seems like puppet is touching > them so their dates are recent, and yet the exec call isn''t being run > when this happens. > > Preferably, I wouldn''t want postfix to touch these files, unless they > are changed on the fileserver, but if it feels it needs to (for > whatever > reason), I would expect that it runs the exec{} that is subscribing > to it.Puppet defaults to using the md5 sum for determining if a file has changed, so if the content is not changing, it will consider the file unchanged. If the content were changing, then Puppet would replace the file from the server and the exec would run. Are you wanting the execs to run even if the files have not changed? -- Everything that is really great and inspiring is created by the individual who can labor in freedom. -- Albert Einstein --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Luke Kanies wrote:> On Jun 2, 2007, at 6:11 PM, Micah Anderson wrote: >> This looks correct. > >> and although I am not changing the content of the source for the >> ''access'' and ''access_client'' files, it seems like puppet is touching >> them so their dates are recent, and yet the exec call isn''t being run >> when this happens. >> >> Preferably, I wouldn''t want postfix to touch these files, unless they >> are changed on the fileserver, but if it feels it needs to (for >> whatever >> reason), I would expect that it runs the exec{} that is subscribing >> to it. > > Puppet defaults to using the md5 sum for determining if a file has > changed, so if the content is not changing, it will consider the file > unchanged. > > If the content were changing, then Puppet would replace the file from > the server and the exec would run. Are you wanting the execs to run > even if the files have not changed?What I am seeing is puppet changing the ctime (or maybe mtime?) on the file, but not modifying the content at all. When I do an ls on the file, the date has been changed, but the content is the same. When postfix sees that the file time on the map has been changed, it complains loudly that the related database is older than the source, even if the content hasn''t changed. What I really want is for the date not to be changed on the file, unless the contents of the file are updated and need to be pulled from the fileserver. If that is not possible, then I suppose I can run the exec when the time changes, although its mostly a NOOP, except for getting rid of the complaints from postfix. micah -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFGY5i79n4qXRzy1ioRAhe3AKCadzsUPu5gzqI78yt8/8m63XIsLACgoO+Y 6T2qWLSydsk1Y2IEyPlyNWQ=WVOi -----END PGP SIGNATURE-----
On Sun, Jun 03, 2007 at 10:44:43PM -0600, Micah Anderson wrote:> What I am seeing is puppet changing the ctime (or maybe mtime?) on the > file, but not modifying the content at all. When I do an ls on the file, > the date has been changed, but the content is the same.Does your problem look at all like this: http://mail.madstop.com/pipermail/puppet-users/2007-January/001092.html - Matt
On Jun 3, 2007, at 11:44 PM, Micah Anderson wrote:> What I am seeing is puppet changing the ctime (or maybe mtime?) on the > file, but not modifying the content at all. When I do an ls on the > file, > the date has been changed, but the content is the same.As the thread that Matt pointed to asked, are you sure it''s Puppet making those changes? Do you get logs indicating that Puppet changed some aspect of the file? If not, then it''s not changing it. -- Barondes'' First Law: Science abhors contradictions; scientists'' minds are replete with them. --------------------------------------------------------------------- Luke Kanies | http://reductivelabs.com | http://madstop.com
Matthew Palmer wrote:> On Sun, Jun 03, 2007 at 10:44:43PM -0600, Micah Anderson wrote: >> What I am seeing is puppet changing the ctime (or maybe mtime?) on the >> file, but not modifying the content at all. When I do an ls on the file, >> the date has been changed, but the content is the same. > > Does your problem look at all like this: > > http://mail.madstop.com/pipermail/puppet-users/2007-January/001092.htmlIt does, and because it does I am curious what you found was your error because I must be doing something similar, but I can''t figure out what it is. micah
On Mon, Jun 04, 2007 at 05:23:43PM -0600, Micah Anderson wrote:> Matthew Palmer wrote: > > On Sun, Jun 03, 2007 at 10:44:43PM -0600, Micah Anderson wrote: > >> What I am seeing is puppet changing the ctime (or maybe mtime?) on the > >> file, but not modifying the content at all. When I do an ls on the file, > >> the date has been changed, but the content is the same. > > > > Does your problem look at all like this: > > > > http://mail.madstop.com/pipermail/puppet-users/2007-January/001092.html > > It does, and because it does I am curious what you found was your error > because I must be doing something similar, but I can''t figure out what > it is.Read to the end of the quoted thread to find out. <grin> - Matt