I''ve got a bit of a head-scratcher here, though I''m sure it must be something small. I''m trying to enable a service for next boot without starting it. That usually "just works" but for some reason this time around it isn''t. The node keeps trying to start the service which will always fail because it requires a reboot in order to enable the necessary kernel parameters. How do I make Puppet stop trying to start the service? The error: err: /Stage[main]/Kdump/Service[kdump]/ensure: change from stopped to running failed: Could not start Service[kdump]: Execution of ''/sbin/service kdump start'' returned 1: at /etc/puppetlabs/puppet/configurations/se/environments/development/modules/kdump/manifests/init.pp:46 The code (minus the comments at the top): 20 class kdump { 21 include grub 22 include sysctl 23 include rebooter::enable 24 25 grub::set_kparam { ''crashkernel'': 26 value => ''128M'', 27 } # grub::set_kparam 28 29 sysctl::conf { 30 ''kernel.core_uses_pid'' : value => 1; 31 ''fs.suid_dumpable'' : value => 1; 32 } # sysctl::conf 33 34 file { "/etc/kdump.conf": 35 mode => "644", 36 source => "puppet:///modules/kdump/kdump.conf", 37 } # file 38 39 file { "/etc/sysconfig/kdump": 40 mode => "644", 41 source => "puppet:///modules/kdump/sysconfig-kdump", 42 } # file 43 44 service { "kdump": 45 enable => true, 46 } # service 47 } # class kdump -- 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, Feb 8, 2012 at 15:34, Aaron Grewell <aaron.grewell@gmail.com> wrote:> I''ve got a bit of a head-scratcher here, though I''m sure it must be > something small. I''m trying to enable a service for next boot without > starting it. That usually "just works" but for some reason this time > around it isn''t. The node keeps trying to start the service which > will always fail because it requires a reboot in order to enable the > necessary kernel parameters. How do I make Puppet stop trying to > start the service?You can''t: if you tell Puppet to ensure the service is running, it will try to start it every time it finds it "out of compliance". There is no standard way for the service to communicate that "a reboot is required" either. Your best bet might be one of: 1. Don''t ensure that is running with Puppet, use something else that is more tolerant or silent. 2. Have an exec that checks those kernel parameters for kdump and automatically reboots. Obviously 2 has ... some risks. :) -- Daniel Pittman ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- 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 02/08/2012 04:11 PM, Daniel Pittman wrote:> You can''t: if you tell Puppet to ensure the service is running, it > will try to start it every time it finds it "out of compliance". >Look at the code. I didn''t ensure => running. I set enable => true. AFAIK that doesn''t mean ''start the service''. -- 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, Feb 8, 2012 at 16:13, Aaron Grewell <aaron.grewell@gmail.com> wrote:> On 02/08/2012 04:11 PM, Daniel Pittman wrote: >> You can''t: if you tell Puppet to ensure the service is running, it >> will try to start it every time it finds it "out of compliance". > > Look at the code. I didn''t ensure => running. I set enable => true. > AFAIK that doesn''t mean ''start the service''.Ah. Sorry, I missed that one small - but critical - detail. My bad. -- Daniel Pittman ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- 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 02/08/2012 04:29 PM, Daniel Pittman wrote:> On Wed, Feb 8, 2012 at 16:13, Aaron Grewell <aaron.grewell@gmail.com> wrote: >> On 02/08/2012 04:11 PM, Daniel Pittman wrote: >>> You can''t: if you tell Puppet to ensure the service is running, it >>> will try to start it every time it finds it "out of compliance". >> >> Look at the code. I didn''t ensure => running. I set enable => true. >> AFAIK that doesn''t mean ''start the service''. > > Ah. Sorry, I missed that one small - but critical - detail. My bad. >No worries. I didn''t mean to sound so cranky, for a moment I was afraid I''d been whacked by the blindingly obvious again... I hate it when that happens. I looked through the manifest for errant defaults or something like that but found nothing. It''s a puzzle. -- 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 Feb 8, 5:34 pm, Aaron Grewell <aaron.grew...@gmail.com> wrote:> I''ve got a bit of a head-scratcher here, though I''m sure it must be > something small. I''m trying to enable a service for next boot without > starting it. That usually "just works" but for some reason this time > around it isn''t. The node keeps trying to start the service which > will always fail because it requires a reboot in order to enable the > necessary kernel parameters. How do I make Puppet stop trying to > start the service?I would try adding "ensure => undef" to the service''s parameters. If that doesn''t work then I can''t imagine what would. 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.
On 02/09/2012 06:16 AM, jcbollinger wrote:> > > On Feb 8, 5:34 pm, Aaron Grewell <aaron.grew...@gmail.com> wrote: >> I''ve got a bit of a head-scratcher here, though I''m sure it must be >> something small. I''m trying to enable a service for next boot without >> starting it. That usually "just works" but for some reason this time >> around it isn''t. The node keeps trying to start the service which >> will always fail because it requires a reboot in order to enable the >> necessary kernel parameters. How do I make Puppet stop trying to >> start the service? > > > I would try adding "ensure => undef" to the service''s parameters. If > that doesn''t work then I can''t imagine what would. > > > John >Thanks John, that did the trick. I''m not sure if I''ve got a service default set somewhere I didn''t realize or what but at least now it''s doing the right thing. -- 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 Thu, Feb 9, 2012 at 11:30, Aaron Grewell <aaron.grewell@gmail.com> wrote:> On 02/09/2012 06:16 AM, jcbollinger wrote: >> On Feb 8, 5:34 pm, Aaron Grewell <aaron.grew...@gmail.com> wrote: >>> I''ve got a bit of a head-scratcher here, though I''m sure it must be >>> something small. I''m trying to enable a service for next boot without >>> starting it. That usually "just works" but for some reason this time >>> around it isn''t. The node keeps trying to start the service which >>> will always fail because it requires a reboot in order to enable the >>> necessary kernel parameters. How do I make Puppet stop trying to >>> start the service? >> >> I would try adding "ensure => undef" to the service''s parameters. If >> that doesn''t work then I can''t imagine what would. > > Thanks John, that did the trick. I''m not sure if I''ve got a service > default set somewhere I didn''t realize or what but at least now it''s > doing the right thing.Thanks, John, indeed. I hoped to find a bit more time to dig in and understand exactly why, but my intuition is that we have a default of `ensure => true` for anything that doesn''t explicitly mention the value. For a service that is the equivalent of `ensure => running`, which would explain the behaviour you saw. For most types that is the right thing to do, if the user is trying to manage something about it. -- Daniel Pittman ⎋ Puppet Labs Developer – http://puppetlabs.com ♲ Made with 100 percent post-consumer electrons -- 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 02/09/2012 11:39 AM, Daniel Pittman wrote:>>> I would try adding "ensure => undef" to the service''s parameters. If >>> that doesn''t work then I can''t imagine what would. >> >> Thanks John, that did the trick. I''m not sure if I''ve got a service >> default set somewhere I didn''t realize or what but at least now it''s >> doing the right thing. > > Thanks, John, indeed. I hoped to find a bit more time to dig in and > understand exactly why, but my intuition is that we have a default of > `ensure => true` for anything that doesn''t explicitly mention the > value. For a service that is the equivalent of `ensure => running`, > which would explain the behaviour you saw. > > For most types that is the right thing to do, if the user is trying to > manage something about it. >If so it''s not well covered in the Type docs. I tested this class under 2.6.x previously and did not experience this issue so it may be a 2.7.x change. A lot has changed about our environment since then so I can''t definitively point at anything but if it''s a change in the Puppet default value for ''ensure'' then the docs should be updated to reflect that. Currently the type docs for 2.7.9 have the following to say about setting ''ensure'' on a service: ensure Whether a service should be running. Valid values are stopped (also called false), running (also called true). -- 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.