Creating your own init script if one is not provided is definitely the best
approach; but failing that, you can still use the "service" resource as a
glorified exec; I've done this w/ my arpwatch daemon on redhat boxes since
it's otherwise difficult to run multiple arpwatch daemons:

##
# maintains an arpwatch daemon for a specified interface
#
# $name: name of interface to monitor
#
define arpwatch::interface {
  $interface = $name

  service { "arpwatch.${interface}":
    provider => "base",
    ensure => running,
    start => "/usr/sbin/arpwatch -i ${interface} -u arpwatch -e root -s 'root
(Arpwat
ch)'",
    stop => "/usr/bin/pkill -f arpwatch.*${interface}",
    status => "/usr/bin/pgrep -f arpwatch.*${interface}",
    require => Class["arpwatch"],
  }
}

-Doug

On 10/18/2011 04:21 PM, Dan White wrote:
> Are there any exapmples out there that show an intelligent way to do this ?
> 
> My searches are not turning up anything useful

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to