cookbook 'daemontools', '= 1.6.14'
daemontools
(24) Versions
1.6.14
-
Follow19
Installs/Configures daemontools
cookbook 'daemontools', '= 1.6.14', :supermarket
knife supermarket install daemontools
knife supermarket download daemontools
Description
Installs DJB's Daemontools and includes a service custom resource.
Requirements
Platform
Tested via Test Kitchen.
- Ubuntu 20.04
- CentOS 7, 8
- AmazonLinux 2
- Gentoo
- ArchLinux
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.
Depending Cookbooks
- pacman - for
aur
recipe, on ArchLinux systems - build-essential - for
source
recipe
Attributes
-
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 besource
,package
oraur
(for ArchLinux). -
node['daemontools']['start_svscan']
- whether to startsvscan
(includes thesvscan
recipe),true
by default. -
node['daemontools']['package_name']
- name of the "daemontools" package, default value varies by platform.
Recipes
default
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.
package
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.
aur
Used on ArchLinux systems to install daemontools from the Arch User Repository (AUR). Exits gracefully without exception if used on other platforms.
source
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.
svscan
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.
Resource
This cookbook includes a custom resource, daemontools_service
, for managing services with daemontools. Examples:
daemontools_service "tinydns-internal" do directory "/etc/djbdns/tinydns-internal" template false action [:enable,:start] end daemontools_service "chef-client" do directory "/etc/sv/chef-client" template "chef-client" action [:enable,:start] log true end
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 thetemplate
resource attribute name. -
log/run
directory and script that runs the logger if the resource attributelog
is true. -
finish
script, if specified using thefinish
resource attribute -
env
directory, containing ENV variables if specified with theenv
resource attribute - links the
node['daemontools']['service_dir']/service_name
to theservice_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
.
Usage
Include the daemontools recipe on nodes that should have daemontools installed for managing services. Use the daemontools_service
custom resource 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 end
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.
Contributors
This project exists thanks to all the people who contribute.
Backers
Thank you to all our backers!
Sponsors
Support this project by becoming a sponsor. Your logo will show up here with a link to your website.
daemontools
This file is used to list changes made in each version of the daemontools cookbook.
1.6.14 - 2023-11-01
1.6.13 - 2023-10-03
1.6.12 - 2023-10-03
1.6.11 - 2023-07-10
1.6.10 - 2023-05-17
1.6.9 - 2023-05-03
1.6.8 - 2023-04-01
1.6.7 - 2023-03-02
1.6.6 - 2023-02-14
1.6.5 - 2023-02-14
- Remove delivery folder
1.6.4 - 2022-01-06
- resolved cookstyle error: recipes/svscan.rb:26:6 refactor:
Chef/Modernize/UseChefLanguageSystemdHelper
- resolved cookstyle error: resources/service.rb:160:1 refactor:
Chef/Modernize/ClassEvalActionClass
1.6.3 - 2021-08-29
- Standardise files with files in sous-chefs/repo-management
v1.6.1 (2020-10-26)
- Adapt to the latest cookstyle (6.21.1)
v1.6.0 (2020-10-16)
- Transferred ownership to sous-chefs
- Updated supported platforms
- Rewrote for new (v12.5+) custom resource
v1.5.0 (2014-12-30)
- Recursively create directory in
daemontools_service
provider (#16) - Add
svscan
recipe for managing thesvscan
service so supervised services bydaemontools_service
work (#12, #21) - Update test kitchen support, add tests (#18)
- Improve recipe readability, adding
package_name
attribute, and refactorpackage
,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
v1.1.0
- COOK-3234 - Fix issue where templates could not be updated after service is enabled
- COOK-3207 - Add Gentoo platform support via package installation
v1.0.2
- [COOK-2688]: missing space between link and name
v1.0.0
- [COOK-1388] - Conditional fix-ups
- [COOK-1428] - Resolve foodcritic warnings
Collaborator Number Metric
1.6.14 passed this metric
Contributing File Metric
1.6.14 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
1.6.14 failed this metric
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): daemontools/resources/service.rb: 1
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
No Binaries Metric
1.6.14 passed this metric
Testing File Metric
1.6.14 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.6.14 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.6.14 passed this metric
1.6.14 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 https://github.com/user/repo, and your repo must contain a CONTRIBUTING.md file
Cookstyle Metric
1.6.14 failed this metric
Chef/Deprecations/ResourceWithoutUnifiedTrue: Set `unified_mode true` in Chef Infra Client 15.3+ custom resources to ensure they work correctly in Chef Infra Client 18 (April 2022) when Unified Mode becomes the default. (https://docs.chef.io/workstation/cookstyle/chef_deprecations_resourcewithoutunifiedtrue): daemontools/resources/service.rb: 1
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
No Binaries Metric
1.6.14 passed this metric
Testing File Metric
1.6.14 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.6.14 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.6.14 failed this metric
Run with Cookstyle Version 7.32.1 with cops Chef/Deprecations,Chef/Correctness,Chef/Sharing,Chef/RedundantCode,Chef/Modernize,Chef/Security,InSpec/Deprecations
1.6.14 passed this metric
Testing File Metric
1.6.14 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 https://github.com/user/repo, and your repo must contain a TESTING.md file
Version Tag Metric
1.6.14 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number
1.6.14 failed this metric
1.6.14 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 https://github.com/user/repo, and your repo must include a tag that matches this cookbook version number