{"record":{"id":"cf318279e2d278bd","repo":"puppetlabs/puppet","slug":"self-class-name-must-specify-a-path-for-daemon","errorCode":null,"errorMessage":"#{self.class.name} must specify a path for daemon directory","messagePattern":"#(.+?) must specify a path for daemon directory","errorType":"exception","errorClass":"Puppet::Error","httpStatus":null,"severity":"error","filePath":"lib/puppet/provider/service/daemontools.rb","lineNumber":113,"sourceCode":"        end\n      end\n      raise \"Could not find service directory\" unless @servicedir\n    end\n    @servicedir\n  end\n\n  # returns the full path of this service when enabled\n  # (ie in the service directory)\n  def service\n    File.join(servicedir, resource[:name])\n  end\n\n  # returns the full path to the current daemon directory\n  # note that this path can be overridden in the resource\n  # definition\n  def daemon\n    path = resource[:path]\n    raise Puppet::Error, \"#{self.class.name} must specify a path for daemon directory\" unless path\n\n    File.join(path, resource[:name])\n  end\n\n  def status\n    begin\n      output = svstat service\n      if output =~ /:\\s+up \\(/\n        return :running\n      end\n    rescue Puppet::ExecutionFailure => detail\n      raise Puppet::Error.new(\"Could not get status for service #{resource.ref}: #{detail}\", detail)\n    end\n    :stopped\n  end\n\n  def setupservice\n    if resource[:manifest]","sourceCodeStart":95,"sourceCodeEnd":131,"githubUrl":"https://github.com/puppetlabs/puppet/blob/e227c27540975c25aa22d533a52424a9d2fc886a/lib/puppet/provider/service/daemontools.rb#L95-L131","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":"# before\nservice { 'tinydns':\n  ensure   => running,\n  provider => 'daemontools',\n}\n\n# after\nservice { 'tinydns':\n  ensure   => running,\n  provider => 'daemontools',\n  path     => '/service',\n}","handlingStrategy":"validation","validationCode":"# in the profile that builds daemontools services\nif $provider == 'daemontools' and $path == undef {\n  fail(\"service ${title}: daemontools provider requires 'path' (svscan service directory)\")\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["puppet","daemontools","service","missing-path"],"backgroundTag":"missing-required-parameter","analyzedSha":"e227c27540975c25aa22d533a52424a9d2fc886a","analyzedAt":"2026-08-21T20:49:46.650Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}