[chef] Re: Re: stop service / config file change / start service


Chronological Thread 
  • From: Steven Parkes < >
  • To: " " < >
  • Subject: [chef] Re: Re: stop service / config file change / start service
  • Date: Fri, 15 Jul 2011 07:12:27 -0700

Thanks for the reply.

Two comments:

First and foremost, as you mention, the networking case is problematic in 
other ways. Thinking about it a little bit more, the issue seems to be more 
about correlating the existing interfaces in the kernel with the config as 
chef sees it. The config comes from multiple places, primarily 
/etc/networking/interfaces but also heartbeat. That correlation seems pretty 
complex and I'm not sure how to address it with chef, if it's possible. A 
configuration change can cause removal/creation of virtual interfaces. Adding 
an interfaces doesn't seem too hard but removing one does, since I'd have to 
have code that knew how many interfaces there were in the old config. Or am I 
missing something?

Second, as to the example you gave, the part that differs from what I was 
looking for is that I was hoping for a mechanism that would use the built-in 
file diffing to determine/coordinate the shutdown/restart.

On Jul 14, 2011, at 11:26 PM, Joshua Timberman wrote:

> Hello!
> 
> On Thu, Jul 14, 2011 at 12:22 PM, Steven Parkes 
> < >
>  wrote:
>> Sorry if this is covered elsewhere, but I'm wondering if there 
>> is/shouldn't be a way to stop a service before making config file changes, 
>> rather than restarting afterwards.
>
>> An example is networking: I want to stop it using the old config and then 
>> start it with the new config. Otherwise, it gets confused because the 
>> number of interfaces may have changed. Doing a stop with the new config 
>> file is not the same thing as doing a stop with the old config.
>
>> Unless there's another/better way to do this ...
> 
> Sure, you can reuse the same named resource and send it multiple
> actions. You'll want a conditional that wraps the recipe so it doesn't
> occur (stop networking) unless necessary). For example, we do this in
> the mysql::server_ec2 recipe to move the data directory of MySQL to
> ephemeral storage (or an EBS volume depending on the attribute
> setting)
> 
> * 
> https://github.com/opscode/cookbooks/blob/master/mysql/recipes/server_ec2.rb
> 
> Though for networking I'd want to be very careful about how this is
> handled as it may be ...problematic if there's an error.
> 
> -- 
> Opscode, Inc
> Joshua Timberman, Director of Training and Services
> IRC, Skype, Twitter, Github: jtimberman




Archive powered by MHonArc 2.6.16.

§