[chef] Re: Re: Re: Re: Chef 10.14.0.rc.1 fails on disabling non-existent services


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Re: Re: Chef 10.14.0.rc.1 fails on disabling non-existent services
  • Date: Thu, 30 Aug 2012 09:00:40 -0700


On Wednesday, August 29, 2012 at 11:36 PM, Andrea Campi wrote:

On Thu, Aug 30, 2012 at 6:19 AM, John Alberts < "> > wrote:
That's great to hear. Thanks



On Wed, Aug 29, 2012 at 10:26 PM, Daniel DeLeo < "> > wrote:

Definitely a bug and probably an easy fix. I'll make sure it gets
attention.

I commented on the ticket—I strongly believe the current behavior is
correct. Here it is for convenience:


There have been questions before, people wondering why Chef doesn't
create an init script—and the general consensus was that the service
resource should assume everything is set up correctly, including an
init script.

Following that line of reasoning, if I ask Chef to stop a service and
the init script is missing, Chef won't be able to stop it—and that's a
fatal error if there ever was one.
The stop action cannot assume the recipe is also calling disable—maybe
the recipe is stopping it to apply some changes and then start it
again. If the service doesn't stop, all bets are off; subsequent
actions may corrupt data and so on.

The disable action is different.
On most distros it doesn't depend on the init script at all, in which
case I agree it can ignore the absence of the init script.
The bottom line is, the service shouldn't swallow exceptions.

I think that's already the case, so here's my vote for rejecting this ticket.

(Note that I'm not arguing the implementation is perfect—if a
distro-specific init system doesn't need the init script to disable
the service yet it fails, then the distro-specific provider should be
fixed. I'm only arguing this shouldn't leak into the generic provider)
From the error message, it looks like it's failing on action 'disable', so it looks like you and John agree on what the behavior should be in this case.

We'll have to see what the behavior is for the 'stop' action in this case. Your argument about the desired behavior for that case is convincing; however, we don't intend to introduce breaking changes in this release, so we'll have to make the behavior for 10.14 match that of 10.12. If we want to make a change, it could go into master, which will become Chef 11.0.0.

-- 
Daniel DeLeo




Archive powered by MHonArc 2.6.16.

§