summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Strauss <Markus@ITstrauss.eu>2011-10-28 21:45:39 +0200
committerMarkus Strauss <Markus@ITstrauss.eu>2011-10-28 21:45:39 +0200
commit384137fe6814498e87a07cc5b74ae2bcb59f895b (patch)
tree6fec55a956b990c95442455f2911508dad1c1be5
parent07cc74784df0283292399acf646a0296ea475c14 (diff)
downloadpuppet-runit-384137fe6814498e87a07cc5b74ae2bcb59f895b.tar.gz
puppet-runit-384137fe6814498e87a07cc5b74ae2bcb59f895b.tar.bz2
added a logdir parameter
-rw-r--r--manifests/service.pp29
1 files changed, 16 insertions, 13 deletions
diff --git a/manifests/service.pp b/manifests/service.pp
index 3258bec..0fed6d9 100644
--- a/manifests/service.pp
+++ b/manifests/service.pp
@@ -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 }