Adoptable Cookbooks List

Looking for a cookbook to adopt? You can now see a list of cookbooks available for adoption!
List of Adoptable Cookbooks

Supermarket Belongs to the Community

Supermarket belongs to the community. While Chef has the responsibility to keep it running and be stewards of its functionality, what it does and how it works is driven by the community. The chef/supermarket repository will continue to be where development of the Supermarket application takes place. Come be part of shaping the direction of Supermarket by opening issues and pull requests or by joining us on the Chef Mailing List.

Select Badges

Select Supported Platforms


daemontools (8) Versions 1.5.0

Installs/Configures daemontools

cookbook 'daemontools', '~> 1.5.0'
cookbook 'daemontools', '~> 1.5.0', :supermarket
knife cookbook site install daemontools
knife cookbook site download daemontools
Quality 56%


Installs DJB's Daemontools and includes a service LWRP.



Tested via Test Kitchen.

  • Debian 7.6
  • Ubuntu 14.04, 12.04, 10.04

This cookbook is known in the past to work on ArchLinux and Gentoo, but as they are rolling release distributions, it is difficult to ensure compatibility over time.

May work on other platforms with or without modification using the "source" installation method. See Attributes and Recipes below.


  • pacman - for aur recipe, on ArchLinux systems
  • build-essential - for source recipe


  • node['daemontools']['bin_dir'] - Sets the location of the binaries for daemontools, default is selected by platform, or '/usr/local/bin' as a fallback.
  • node['daemontools']['service_dir'] - Daemontools "service" directory where svscan will find services to manage.
  • node['daemontools']['install_method'] - how to install daemontools, can be source, package or aur (for ArchLinux).
  • node['daemontools']['start_svscan'] - whether to start svscan (includes the svscan recipe), true by default.
  • node['daemontools']['package_name'] - name of the "daemontools" package, default value varies by platform.



The default recipe includes the appropriate installation method's recipe using the node['daemontools']['install_method'] attribute.

If the start_svscan attribute is true, then include the svscan recipe too.


Installs the daemontools package, using the node['daemontools']['package_name'] attribute. On Debian family systems, this is daemontools-run, which depends on daemontools (and provides run time / init system configuration).

On other untested platforms (e.g., RHEL family), if a local daemontools package is built and it sets up the appropriate init system configuration (systemd, upstart, inittab), then this recipe will be sufficient. Otherwise, write a custom recipe.


Used on ArchLinux systems to install daemontools from the Arch User Repository (AUR). Exits gracefully without exception if used on other platforms.


The source installation of daemontools should work on most other platforms that do not have a package available. A custom recipe may be required to configure the svscan service init script or upstart or systemd configuration.


Enables and starts the svscan service. This requires that the local system have properly set up the svscan service for the appropriate init system. It's outside the scope of this cookbook to detect this for every possible platform, so a custom recipe may be required. For example, Debian family daemontools-run package provides this.


This cookbook includes an LWRP, daemontools_service, for managing services with daemontools. Examples:

daemontools_service "tinydns-internal" do
  directory "/etc/djbdns/tinydns-internal"
  template false
  action [:enable,:start]

daemontools_service "chef-client" do
  directory "/etc/sv/chef-client"
  template "chef-client"
  action [:enable,:start]
  log true

Daemontools itself can perform a number of actions on services. The following are commands sent via the svc program. See its man page for more information.

  • start, stop, status, restart, up, down, once, pause, cont, hup, alrm, int, term, kill

Enabling a service (:enable action) is done by setting up the directory located by the directory resource attribute. The following are set up:

  • run script that runs the service startup using the template resource attribute name.
  • log/run directory and script that runs the logger if the resource attribute log is true.
  • finish script, if specified using the finish resource attribute
  • env directory, containing ENV variablesif specified with the env resource attribute
  • links the node['daemontools']['service_dir']/service_name to the service_name directory.

The default action is :start - once enabled daemontools services are started by svscan anyway.

The name attribute for the resource is service_name.


Include the daemontools recipe on nodes that should have daemontools installed for managing services. Use the daemontools_service LWRP for any services that should be managed by daemontools. In your cookbooks where daemontools_service is used, create the appropriate run and log-run scripts for your service. For example if the service is "flowers":

daemontools_service "flowers" do
  directory "/etc/sv/flowers"
  template "flowers"
  action [:enable, :start]
  log true

Create these templates in your cookbook:

  • templates/default/sv-flowers-run.erb
  • templates/default/sv-flowers-log-run.erb

If your service also has a finish script, set the resource attribute finish to true and create sv-flowers-finish.erb.

The content of the scripts should be appropriate for the "flowers" service.

License and Author

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

daemontools Cookbook CHANGELOG

This file is used to list changes made in each version of the daemontools cookbook.

v1.5.0 (2014-12-30)

  • Recursively create directory in daemontools_service provider (#16)
  • Add svscan recipe for managing the svscan service so supervised services by daemontools_service work (#12, #21)
  • Update test kitchen support, add tests (#18)
  • Improve recipe readability, adding package_name attribute, and refactor package, source recipes
  • Add pacman as a dependency so ArchLinux "just works"

v1.4.0 (2014-12-15)

  • Adding variables parameter to templates in service LWRP

v1.3.0 (2014-04-23)

  • COOK-2655 : Replace "execute" method with "run_command_with_systems_locale"

v1.2.0 (2014-02-25)

  • [COOK-4181] - Parameterize source tarball location



  • COOK-3234 - Fix issue where templates could not be updated after service is enabled

New Feature

  • COOK-3207 - Add Gentoo platform support via package installation



  • [COOK-2688]: missing space between link and name


  • [COOK-1388] - Conditional fix-ups
  • [COOK-1428] - Resolve foodcritic warnings

Collaborator Number Metric

1.5.0 failed this metric

Failure: Cookbook has 1 collaborators. A cookbook must have at least 2 collaborators to pass this metric.

Contributing File Metric

1.5.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Foodcritic Metric

1.5.0 failed this metric

FC064: Ensure issues_url is set in metadata: daemontools/metadata.rb:1
FC065: Ensure source_url is set in metadata: daemontools/metadata.rb:1
FC066: Ensure chef_version is set in metadata: daemontools/metadata.rb:1
FC069: Ensure standardized license defined in metadata: daemontools/metadata.rb:1
FC074: LWRP should use DSL to define resource's default action: daemontools/resources/service.rb:1
Run with Foodcritic Version 13.0.0 with tags metadata,correctness ~FC031 ~FC045 and failure tags any

License Metric

1.5.0 passed this metric

No Binaries Metric

1.5.0 passed this metric

Publish Metric

1.5.0 passed this metric

Supported Platforms Metric

1.5.0 passed this metric

Testing File Metric

1.5.0 failed this metric

Failure: To pass this metric, your cookbook metadata must include a source url, the source url must be in the form of, and your repo must contain a file

Version Tag Metric

1.5.0 passed this metric