On Aug 10, 12:04 am, Haitao Jiang <jianghai...@gmail.com> wrote:
> I put it under modules/xyz/manifests/classes/xyz_new.pp

For Puppet auto-loading, the full path to that file should be:

modules/xyz/manifests/xyz_new.pp

and you won't need any 'import' statements.

> The problem is that when I include this new class xyz_new, Puppet
> complained about can not find init
>
> err: /Stage[main]/xyz/Service[xyz]: Could not evaluate: Could not find
> init script for 'xyz'

After some experimenting, you need to also override the 'status'
parameter, as Puppet needs to check if a service is alive or not to
figure out if it has to start and stop. This example will restart
Apache if it's down:

class foo {
  service { "woof":
    ensure => running,
  }
}

class bar inherits foo {
  Service["woof"] {
    start => "/etc/init.d/httpd start",
    status => "/etc/init.d/httpd status",
  }
}

include bar

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to