- From: Joshua Miller <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Running chef-client as a service
- Date: Tue, 1 Jun 2010 16:09:15 -0700
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=subject:mime-version:content-type:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=eviJyB5xmxvbGOZmGBY4mMwOjUdtziRQTUFU8mrhj4mn1ZZQwS5dZ/9fYFw3rsqJnb EWMbCL2bmGk2e1huw/0yYK1z3CsXLBJZ6EvRJJWd8HNCzIrGjCZy1EGaCqQTZyIxTS31 piX6QGeootoNwh4bdtLFswL/2/dVxEevfHmSs=
/etc/init.d/chef-client is there for any admin who is new to upstart, the
simple script avoid them needing to know. In my office if something MUST be
changed ASP and I can not be reached I just tell them stop chef drop me a
email and we will fix it once I get back. Its just a matter of covering the
incase I am out of touch.
On Jun 1, 2010, at 4:04 PM, Joshua Timberman wrote:
>
Fwiw, I planned to investigate supporting upstart as an "init_style" in the
>
bootstrap recipe. The next version of Chef and accompanying
>
chef::bootstrap_* recipes will support init scripts that are pulled from
>
the installed gem.
>
>
On Jun 1, 2010, at 6:43 AM, Dmitry V'yal
>
<
>
>
wrote:
>
>
> On 05/31/2010 08:57 PM, Joshua Miller wrote:
>
>> Here is what I do for my debian package installs, one problem I have not
>
>> fixed is it does not reload chef upstart when the values change ... new
>
>> to upstart and a restart does not pickup the new vars so I have to
>
>> figure it out later. Since I dont change it much I have not really cared.
>
>>
>
>
>
> thanks for sharing. I adopted your recipe, but turned the service into the
>
> task run by cron. RAM is precious resource on VPS.
>
> I couldn't find a proper way to calculate times for cron, though. Also I
>
> think /etc/init.d/chef-client is not really necessary.
>
>
>
> This what is have for now:
>
>
>
> $ cat chef/recipes/client-deb.rb
>
> case node[:platform]
>
> when "ubuntu"
>
> if node[:platform_version].to_f >= 9.10
>
> service "chef-client" do
>
> provider Chef::Provider::Service::Upstart
>
> supports :restart => true, :reload => true
>
> end
>
>
>
> template "/etc/init/chef-client.conf" do
>
> source "upstart-chef-client.conf.erb"
>
> owner "root"
>
> group "root"
>
> mode 0644
>
> backup 0
>
> notifies :start, resources(:service => "chef-client")
>
> not_if do File.symlink?("/etc/init.d/chef-server") end
>
> end
>
>
>
> cron "chef-client" do
>
> minute ((0..59).to_a.delete_if {|x| x %
>
> (@node[:chef][:client_interval].to_i / 60) != 0 }.join ",")
>
> command "service chef-client start"
>
> end
>
> end
>
> end
>
>
>
> % cat chef/templates/default/upstart-chef-client.conf.erb
>
> start on runlevel [2345]
>
>
>
> task
>
>
>
> script
>
> exec /usr/bin/env chef-client -c /etc/chef/client.rb -s <%=
>
> @node[:chef][:client_splay] %>
>
> end script
Archive powered by MHonArc 2.6.16.