Module Chef::Expander::Daemonizable
In: lib/chef/expander/daemonizable.rb

Methods

Included Modules

Loggable

Public Instance methods

Daemonizes the process if configured to do so, and ensures that only one copy of the process is running with a given config by obtaining an exclusive lock on the pidfile. Also sets process user and group if so configured.

Raises

  • AlreadyRunning::: when another process has the exclusive lock on the pidfile
  • NoSuchUser::: when a user is configured that doesn‘t exist
  • NoSuchGroup::: when a group is configured that doesn‘t exist
  • SystemCallError::: if there is an error creating the pidfile

When not forking into the background, this ensures only one chef-expander is running with a given config and writes the process id to the pidfile.

Deletes the pidfile, releasing the exclusive lock on it in the process.

[Validate]