cookbook 'dpkg_autostart', '= 0.1.12'
dpkg_autostart
(25) Versions
0.1.12
-
Follow12
Control service actions initialized from dpkg
cookbook 'dpkg_autostart', '= 0.1.12', :supermarket
knife supermarket install dpkg_autostart
knife supermarket download dpkg_autostart
Dpkg Autostart
dpkg
likes to start services after installation as the Debian convention
dictates. This can be annoying and problematic, especially when you don't
want services to be immediately started before custom configuration can
be applied. Instead of disabling all services from auto starting on installation
as the dpkg_deb_unautostart
cookbook does, lets allow specifc services
to be targeted.
Usage
LWRP
Include the cookbook as a dependency in your metadata:
depends 'dpkg_autostart'
Then, within your recipe, disable the service with the LWRP:
dpkg_autostart 'mysql-server' do allow false end
That's it. When dpkg
attempts to start the service after install (generally
via apt
) it will be instructed not to. This allows the proper configuration
files to be generated, and the service to be started after everything is
ready.
Attribute
You can also provide a list of services to disable via node attribute. Add
the default recipe to the run list:
run_list 'recipe[dpkg_autostart]'
and set the services you want to restrict from auto starting:
node[:dpkg_autostart][:disabled_services] = ['mysql-server', 'apache2']
Info
- Repository: https://github.com/hw-cookbooks/dpkg_autostart
- IRC: Freenode @ #heavywater
Related
- deb_pkg_unautostart: http://ckbk.it/deb_pkg_unautostart
Dependent cookbooks
This cookbook has no specified dependencies.
Contingent cookbooks
v0.1.12
- Be a noop except on debian family
v0.1.10
- Add support for upstart services (thanks @bkw)
v0.1.8
- Add support for Chef 10 (#3)
- Properly update
resource_collection
when unshifting (#4)- Thanks @mpasternacki
v0.1.6
- Fix version number
v0.1.4
- Use "heavyweight" resource/provider
- Fix execution error on initial runs (#2)
v0.1.2
- Add explicit
:create
action to template
v0.1.0
- Initial commit
Foodcritic Metric
0.1.12 failed this metric
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/attributes/default.rb:1
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/attributes/default.rb:2
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/libraries/resource.rb:16
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/libraries/resource.rb:17
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/templates/default/policy-rc.d.erb:3
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/templates/default/policy-rc.d.erb:5
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/templates/default/policy-rc.d.erb:6
0.1.12 failed this metric
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/attributes/default.rb:2
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/libraries/resource.rb:16
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/libraries/resource.rb:17
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/templates/default/policy-rc.d.erb:3
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/templates/default/policy-rc.d.erb:5
FC001: Use strings in preference to symbols to access node attributes: /tmp/cook/29b151c71c1ea559c9ea5ee2/dpkg_autostart/templates/default/policy-rc.d.erb:6