- From: Joseph Holsten <
>
- To: Chef Dev <
>
- Subject: [chef-dev] debian services enable on every run
- Date: Wed, 18 Dec 2013 03:38:36 +0000
I was trying to kill spurious resource updating, and noticed that on ubuntu
the nginx cookbook will re-enable the nginx resource on every run.
So far as I can tell, everything comes down to this line in
Chef::Provider::Service::Debian#action_enable:
https://github.com/opscode/chef/blob/master/lib/chef/provider/service/debian.rb#L116
The trick is that it not only verifies that the service is enabled (duh) but
that the desired priority matches the current priority.
But looking at the service resource's initializer:
https://github.com/opscode/chef/blob/master/lib/chef/resource/service.rb#L44
and #priority:
https://github.com/opscode/chef/blob/master/lib/chef/resource/service.rb#L153
You can see that the default
will be nil, whereas the default
for a sane enabled service will be something like:
{
0 => :stop,
1 => :stop,
2 => :start,
3 => :start,
4 => :start,
5 => :start,
6 => :stop
}
What's the reasonable thing to do? Have init-style services explicitly define
their priorities (not-newb-friendly)? Only check if the service is enabled
(that is, enabled in any of run levels 2-5)? Set a non-nil default priority
for init services? Something else?
--
~j
Attachment:
signature.asc
Description: Message signed with OpenPGP using GPGMail
- [chef-dev] debian services enable on every run, Joseph Holsten, 12/17/2013
Archive powered by MHonArc 2.6.16.