Arnau Bria
2009-Nov-10 14:38 UTC
[Puppet Users] how to manage a service that enables a cron
Hi all, I''ve been reading http://reductivelabs.com/trac/puppet/wiki/TypeReference#service and I did not find out how to manage a service that only enables a cron: like: # /etc/init.d/pakiti status nightly pakiti update is disabled # /etc/init.d/yum status Nightly yum update is disabled. status does not works for me cause process won''t be in proc table... anyone could give some help on this? Soemthing that is not managing cron by puppet :-) Cheers, Arnau --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jcbollinger
2009-Nov-11 15:17 UTC
[Puppet Users] Re: how to manage a service that enables a cron
On Nov 10, 8:38 am, Arnau Bria <arnaub...@pic.es> wrote:> I''ve been readinghttp://reductivelabs.com/trac/puppet/wiki/TypeReference#serviceand I > did not find out how to manage a service that only enables a cron: > > like: > > # /etc/init.d/pakiti status > nightly pakiti update is disabled > > # /etc/init.d/yum status > Nightly yum update is disabled. > > status does not works for me cause process won''t be in proc table... > > anyone could give some help on this? Soemthing that is not managing > cron by puppet :-)If your initscript supports a status argument (as RedHat-provided ones do) then you can instruct Puppet to use it by setting hasstatus => true on your Service resource(s). If that''s not sufficient for you then I''m afraid you''ll have to describe your problem in more detail (the Puppet manifest code you''re trying to use would be part of that). John --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Arnau Bria
2009-Nov-11 16:13 UTC
[Puppet Users] Re: how to manage a service that enables a cron
On Wed, 11 Nov 2009 07:17:05 -0800 (PST) jcbollinger jcbollinger wrote: Hi John,> If your initscript supports a status argument (as RedHat-provided ones > do) then you can instruct Puppet to use it by setting > > hasstatus => true > > on your Service resource(s).That''s what I understood and I already have it: service {"pakiti": enable => "true", name => "pakiti", start => "/etc/init.d/pakiti start", status => "/etc/init.d/pakiti status", stop => "/etc/init.d/pakiti stop", ensure => "running", hasstatus => "true", require => Package["pakiti-client"], } and here the test: # /etc/init.d/pakiti status nightly pakiti update is enabled # /etc/init.d/pakiti stop Disabling pakiti: [ OK ] # /etc/init.d/pakiti status nightly pakiti update is disabled and I also stop gmond cause they are under same class, so you''ll see how puppet only restarts gmond: # /etc/init.d/gmond stop Shutting down GANGLIA gmond: [ OK ] # /etc/init.d/gmond status gmond is stopped # puppetd --test --server server.domain.com info: Caching catalog at /var/lib/puppet/localconfig.yaml notice: Starting catalog run notice: /:main/Node[ce08.domain.com]/basic_sl47_service/local_conf_services/local_conf_basic/Service[gmond]/ensure: ensure changed ''stopped'' to ''running'' notice: Finished catalog run in 16.77 seconds # /etc/init.d/gmond status gmond (pid 18026) is running... # /etc/init.d/pakiti status nightly pakiti update is disabled> If that''s not sufficient for you then > I''m afraid you''ll have to describe your problem in more detail (the > Puppet manifest code you''re trying to use would be part of that).I''m just trying to control a service that does not run a process but enables a cron (like yum autoupdate or pakiti). Do you mean that I have to use: manifest Specify a command to config a service, or a path to a manifest to do so. any example avaliable?> JohnThanks for your rpely John! Arnau --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Arnau Bria
2009-Nov-12 13:02 UTC
[Puppet Users] Re: how to manage a service that enables a cron
Hi all, I would not like to confuse people. What I described in OT only happens to pakiti service and not to yum. So I suppose it''s a "service" specific problem. It has its own init script but must behaves diff from standrd RH service. Cheers, Arnau --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thomas Bellman
2009-Nov-12 13:08 UTC
[Puppet Users] how to manage a service that enables a cron
Arnau Bria wrote:> # /etc/init.d/pakiti status > nightly pakiti update is enabled > # /etc/init.d/pakiti stop > Disabling pakiti: [ OK ] > # /etc/init.d/pakiti status > nightly pakiti update is disabledNow try this: # /etc/init.d/pakiti start # /etc/init.d/pakiti status; echo $? # /etc/init.d/pakiti stop # /etc/init.d/pakiti status; echo $? The status command should return 0 when the service is "running", but 3 when it is not. Init scripts not doing so is a fairly common problem. The vast majority of the packages in RHEL and CentOS do the right thing, and if you find one that doesn''t, you can file a bug report with RedHat about it. Init scripts from other sources are not always so well behaved though... /Bellman --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
jcbollinger
2009-Nov-12 14:55 UTC
[Puppet Users] Re: how to manage a service that enables a cron
On Nov 11, 10:13 am, Arnau Bria <arnaub...@pic.es> wrote:> I''m just trying to control a service that does not run a process but > enables a cron (like yum autoupdate or pakiti).What Bellman said. Puppet is limited in what it can do for you if your initscipt''s status command doesn''t return an accurate status. If you have a broken initscript and you can''t fix it / get it fixed, then there are alternatives: 1) Live with the error. Puppet will try to "start" the service every time it runs. If afterward it double-checks that the service is running (I''m uncertain whether it does) then it will report an error. As long as nothing else has a declared dependency on the Service then such an error can probably be ignored. 2) You may be able to configure the Service so that Puppet doesn''t manage whether or not it''s running. Try leaving out the "ensure" parameter, and if that doesn''t work then try setting it to undef (ensure => undef). The idea is that Puppet will manage the links in / etc/rc*.d/, but it won''t try to start (or stop) the service. With that said, it would be far better to use a correct initscript . John --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Arnau Bria
2009-Nov-12 15:10 UTC
[Puppet Users] Re: how to manage a service that enables a cron
Hi Thomas, that''s the problem.... all status return code is 0... Thanks, going to contact developer and see if he accepts a patch. Cheers, Arnau --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---