puppetlabs/puppet · error · Puppet::Error

# 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.

Solutions

  1. Add the path parameter pointing at your svscan service directory to the service resource
  2. Verify that directory exists on the node (ls /service) and that svscan is actually running
  3. 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

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 argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of puppetlabs/puppet@e227c27540 (2026-08-21). Data as JSON: /api/errors/cf318279e2d278bd. Report an issue: GitHub.

Appendix: 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)