Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to be able to add some requires to a file I setup:

define daemontools::service(
  $ensure = 'running',
  case $ensure {
    'running': { $real_ensure = $source }
    'stopped': { $real_ensure = 'absent' }
    default: { fail("no such ensure for daemontools::service") }

    ensure => $real_ensure,
    require=> Package['daemontools']

  # This is the part that gets confusing
  if $require {
    File["/etc/service/${name}"]{ require +> $require }

# in some other class somewhere

  require => [Package['djbdns'],Exec['tinydns_setup']]

The LanguageTutorial seems to think this will work, but it only results in the error message: Parameter 'require' is already set on File[/etc/service/tinydns] by daemontools::service

share|improve this question
up vote 2 down vote accepted

Get rid of the if $require -- it's completely unnecessary. Metaparameters like require apply to defined types just as well as they do to native types, so nothing in your daemontools::service resource will run until the requires on it are successfully run.

share|improve this answer
Doh, easier than I thought... – gnarf Sep 20 '09 at 2:38

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.