]> gitweb.fluxo.info Git - puppet-runit.git/commitdiff
added a logdir parameter
authorMarkus Strauss <Markus@ITstrauss.eu>
Fri, 28 Oct 2011 19:45:39 +0000 (21:45 +0200)
committerMarkus Strauss <Markus@ITstrauss.eu>
Fri, 28 Oct 2011 19:45:39 +0000 (21:45 +0200)
manifests/service.pp

index 3258bec149367fb4e57d0e7cd60dec09322c9b21..0fed6d99d5d5eed1bee85b17557dbe9770979950 100644 (file)
@@ -1,25 +1,28 @@
 define runit::service (
-  $user     = root,       # the service's user name
-  $group    = root,       # the service's group name
-  $enable   = true,       # shall the service be linked to /etc/service
-  $ensure   = present,    # shall the service be present in /etc/sv
+  $user    = root,       # the service's user name
+  $group   = root,       # the service's group name
+  $enable  = true,       # shall the service be linked to /etc/service
+  $ensure  = present,    # shall the service be present in /etc/sv
   # either one of these three must be declared - it defines the content of the run script /etc/sv/$name/run
-  $commmand = undef,      # the most simple way;  just state command here - it may not daemonize itself,
-                          # but rather stay in the foreground;  all output is logged automatically to $logdir/current
-                          # this uses a default template which provides logging
-  $source   = undef,      # specify a source file on your puppet master 
-  $content  = undef,      # specify the content directly (mostly via 'template')
+  $command = undef,      # the most simple way;  just state command here - it may not daemonize itself,
+                         # but rather stay in the foreground;  all output is logged automatically to $logdir/current
+                         # this uses a default template which provides logging
+  $source  = undef,      # specify a source file on your puppet master 
+  $content = undef,      # specify the content directly (mostly via 'template')
   # service directory - this is required if you use 'command'
-  $rundir   = undef,
+  $rundir  = undef,
   # logging stuff
-  $logger   = false,      # shall we setup an logging service;  if you use 'command' before, 
-                          # all output from command will be logged automatically to $logdir
-  $logdir   = $svdir      # override logging directory
+  $logger  = true,       # shall we setup an logging service;  if you use 'command' before, 
+                         # all output from command will be logged automatically to $logdir/current
+  $logdir  = "${rundir}/log"
 ) {
 
   # FixMe: Validate parameters
   # fail("Only one of 'command', 'content', or 'source' parameters is allowed")
 
+  if $command != undef and $rundir == undef {
+    fail( "You need to specify 'rundir': That's the directory from which the service will be started.")
+  }
 
   # resource defaults
   File { owner => root, group => root, mode => 644 }