Hi, I''m having difficulty letting a service start automaticly. The problem that''s occurring is with just one class/service. I have made other classes and service definitions in it who are all working fine. Here''s the class i use for auditd: class audit { package { "audit": ensure => present, } remotefile { "/etc/audit/auditd.conf": mode => 640, source => "apps/audit/auditd.conf", require => Package["audit"], } service { "auditd": ensure => running, enable => true, hasrestart => true, subscribe => File["/etc/audit/auditd.conf"], require => Package["audit"], } } The package gets installed, but if the file (/etc/audit/auditd.conf) already exists, the service isn''t being restarted. If i delete the file and run puppetd again, the service is started right after the file is created. Before this, i didn''t even had the service subscribe to a file, thinking this caused the problem. I''m using puppet version 0.24.5 kind regards, Sebastian. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Don''t mean to be annoying, but i kind of ran out of ideas. If anyone can help it would be appreciated. If not, i have to look for another (ugly) solution. thanks, S. On Thu, Oct 23, 2008 at 3:11 PM, Sebastian Vieira <sebvieira@gmail.com>wrote:> Hi, > > I''m having difficulty letting a service start automaticly. The problem > that''s occurring is with just one class/service. I have made other classes > and service definitions in it who are all working fine. Here''s the class i > use for auditd: > > class audit { > > package { > "audit": > ensure => present, > } > > remotefile { > "/etc/audit/auditd.conf": > mode => 640, > source => "apps/audit/auditd.conf", > require => Package["audit"], > } > > service { > "auditd": > ensure => running, > enable => true, > hasrestart => true, > subscribe => File["/etc/audit/auditd.conf"], > require => Package["audit"], > } > > } > > The package gets installed, but if the file (/etc/audit/auditd.conf) > already exists, the service isn''t being restarted. If i delete the file and > run puppetd again, the service is started right after the file is created. > > Before this, i didn''t even had the service subscribe to a file, thinking > this caused the problem. > > I''m using puppet version 0.24.5 > > kind regards, > > Sebastian. > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
what happens if you add a subscribe for the package to the service? service { "auditd": ensure => running, enable => true, hasrestart => true, subscribe => [ File["/etc/audit/auditd.conf"], Package["audit"] ], require => Package["audit"], } Sebastian Vieira schrieb:> Don''t mean to be annoying, but i kind of ran out of ideas. If anyone can help it would be appreciated. If not, i have to look for another (ugly) solution. > > thanks, > S. > > > On Thu, Oct 23, 2008 at 3:11 PM, Sebastian Vieira <sebvieira@gmail.com> wrote: > > > Hi, > > I''m having difficulty letting a service start automaticly. The problem that''s occurring is with just one class/service. I have made other classes and service definitions in it who are all working fine. Here''s the class i use for auditd: > > class audit { > > package { > "audit": > ensure => present, > } > > remotefile { > "/etc/audit/auditd.conf": > mode => 640, > source => "apps/audit/auditd.conf", > require => Package["audit"], > } > > service { > "auditd": > ensure => running, > enable => true, > hasrestart => true, > subscribe => File["/etc/audit/auditd.conf"], > require => Package["audit"], > } > > } > > The package gets installed, but if the file (/etc/audit/auditd.conf) already exists, the service isn''t being restarted. If i delete the file and run puppetd again, the service is started right after the file is created. > > Before this, i didn''t even had the service subscribe to a file, thinking this caused the problem. > > I''m using puppet version 0.24.5 > > kind regards, > > Sebastian. > > > > > > --~--~---------~--~----~------------~-------~--~----~ > You received this message because you are subscribed to the Google Groups "Puppet Users" group. > To post to this group, send email to puppet-users@googlegroups.com > To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com > For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en > -~----------~----~----~----~------~----~------~--~--- > > >--
On Wed, Nov 05, 2008 at 01:10:41PM +0100, Sebastian Vieira wrote:> Don''t mean to be annoying, but i kind of ran out of ideas. If anyone can > help it would be appreciated. If not, i have to look for another (ugly) > solution.My guess is that it works when you delete the file, because the File resource explicitly notifies the Service resource, resulting in a restart. However when the file is already there, all that happens is the service resource looks in the process list to check if the service is already running. My guess is that it think it is running, so it does nothing. Have a closer look at http://reductivelabs.com/trac/puppet/wiki/TypeReference#service to see how the service type checks for running services and how you can tweak that. -- Marcin Owsiany <marcin@owsiany.pl> http://marcin.owsiany.pl/ GnuPG: 1024D/60F41216 FE67 DA2D 0ACA FC5E 3F75 D6F6 3A0D 8AA0 60F4 1216 "Every program in development at MIT expands until it can read mail." -- Unknown --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, Nov 5, 2008 at 4:04 PM, Phillip Scholz <phillip.scholz@1und1.de>wrote:> what happens if you add a subscribe for the package to the service? > > > service { > "auditd": > ensure => running, > enable => true, > hasrestart => true, > subscribe => [ File["/etc/audit/auditd.conf"], > Package["audit"] ], > require => Package["audit"], > } >Same result, unfortunately. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, Nov 5, 2008 at 4:09 PM, Marcin Owsiany <marcin@owsiany.pl> wrote:> > My guess is that it works when you delete the file, because the File > resource explicitly notifies the Service resource, resulting in a > restart. >I think your guess is accurate :)> However when the file is already there, all that happens is the service > resource looks in the process list to check if the service is already > running. My guess is that it think it is running, so it does nothing.I think it ''greps'' incorrectly, because i see [kauditd] running and can only assume it thinks it has a match for ''auditd''. Have a closer look at> http://reductivelabs.com/trac/puppet/wiki/TypeReference#service > to see how the service type checks for running services and how you can > tweak that.I have done that but fail to see how i can further tweak it. thanks, Sebastian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
Hi>> However when the file is already there, all that happens is the service >> resource looks in the process list to check if the service is already >> running. My guess is that it think it is running, so it does nothing. > > > I think it ''greps'' incorrectly, because i see [kauditd] running and can only > assume it thinks it has a match for ''auditd''.I assume that this is the problem. There are several solutions of it: - If the init.d script provides the status option you can set the hasstatus fo the service to true, so it will call the init.d script and check with that. - Otherwise you could provide another pattern to grep by setting the pattern. - However it might be as well an option to improve the way how puppet greps for the service directly in the code. Many ways to solve your problem ;) greets pete --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---
On Wed, Nov 5, 2008 at 4:48 PM, Peter Meier <peter.meier@immerda.ch> wrote:> - If the init.d script provides the status option you can set the > hasstatus fo the service to true, so it will call the init.d script and > check with that.Yes sir, that solved the issue. Thanks a lot :) - However it might be as well an option to improve the way how puppet> greps for the service directly in the code.I think this is still a good idea though. kind regards, Sebastian --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Puppet Users" group. To post to this group, send email to puppet-users@googlegroups.com To unsubscribe from this group, send email to puppet-users+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/puppet-users?hl=en -~----------~----~----~----~------~----~------~--~---