puppetlabs/puppet · error · Puppet::Error
#{self.class.name} must specify a path for daemon directory
Error message
#{self.class.name} must specify a path for daemon directory What it means
The daemontools service provider builds the daemon directory as File.join(resource[:path], resource[:name]) inside the daemon method, and raises when resource[:path] is nil. Unlike the servicedir (a class-level confine), the daemon path is expected to come from the service resource itself, so every daemontools-managed service must declare a path parameter.
Source
Thrown at lib/puppet/provider/service/daemontools.rb:113
end
end
raise "Could not find service directory" unless @servicedir
end
@servicedir
end
# returns the full path of this service when enabled
# (ie in the service directory)
def service
File.join(servicedir, resource[:name])
end
# returns the full path to the current daemon directory
# note that this path can be overridden in the resource
# definition
def daemon
path = resource[:path]
raise Puppet::Error, "#{self.class.name} must specify a path for daemon directory" unless path
File.join(path, resource[:name])
end
def status
begin
output = svstat service
if output =~ /:\s+up \(/
return :running
end
rescue Puppet::ExecutionFailure => detail
raise Puppet::Error.new("Could not get status for service #{resource.ref}: #{detail}", detail)
end
:stopped
end
def setupservice
if resource[:manifest]View on GitHub (pinned to e227c27540)
Solutions
- Add the path parameter pointing at your svscan service directory to the service resource
- Verify that directory exists on the node (ls /service) and that svscan is actually running
- Keep resource titles aligned with the directory names under the service dir, since daemon joins path + name
Example fix
# before
service { 'tinydns':
ensure => running,
provider => 'daemontools',
}
# after
service { 'tinydns':
ensure => running,
provider => 'daemontools',
path => '/service',
} Defensive patterns
Strategy: validation
Validate before calling
# in the profile that builds daemontools services
if $provider == 'daemontools' and $path == undef {
fail("service ${title}: daemontools provider requires 'path' (svscan service directory)")
} Prevention
- Encode the rule once in a shared profile/defined type so every daemontools service declares path
- Smoke-test new service declarations with puppet resource service <name> provider=daemontools path=/service on a scratch node
- Validate parameters in a class contract (e.g. puppetlabs/stdlib validate_* or data types) so failures occur at compile time
When it happens
Trigger: Declaring service { 'foo': provider => 'daemontools' } without a path attribute, then performing any operation that reaches daemon (enable/disable/start/stop flows that inspect the daemon directory) during a catalog run or via puppet resource service foo provider=daemontools.
Common situations: Porting init-script style service declarations to a svscan box and keeping the old attributes; copy-pasting a service resource from another module that never set path; assuming path is optional because other service providers infer it.
Understand the failure class
Background: Missing required parameter errors: what 'X is required' and 'the required X param is missing' mean, and how to fix them — this error's family across 27 libraries.
Related errors
- Unable to verify the SSL certificate at %{uri}
- Mounts without paths are not usable
- Unknown service #{name}
- Could not determine module path
- Could not disable #{name}: #{output}
AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21).
Data as JSON: /api/errors/cf318279e2d278bd.
Report an issue: GitHub.