summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-23 15:26:33 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-23 15:26:33 +0000
commit53f3b8c8bbb5adc1e0eaf1806f328ec39534b3ec (patch)
tree862d9ad136fad96ae96bfc73a095110f7bd5deec /lib
parentc285d7af0eea29e787eb889d393145da72402b56 (diff)
downloadpuppet-53f3b8c8bbb5adc1e0eaf1806f328ec39534b3ec.tar.gz
puppet-53f3b8c8bbb5adc1e0eaf1806f328ec39534b3ec.tar.xz
puppet-53f3b8c8bbb5adc1e0eaf1806f328ec39534b3ec.zip
Fixing rundir so that it does not throw an error when not running as root
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2080 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/configuration.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/lib/puppet/configuration.rb b/lib/puppet/configuration.rb
index 4fbcbe135..e89a8abad 100644
--- a/lib/puppet/configuration.rb
+++ b/lib/puppet/configuration.rb
@@ -29,6 +29,12 @@ module Puppet
logopts = ["$vardir/log", "The Puppet log directory."]
end
setdefaults(:puppet, :logdir => logopts)
+
+ if Process.uid == 0
+ rundir = "/var/run/puppet"
+ else
+ rundir = "$vardir/run"
+ end
self.setdefaults(:puppet,
:trace => [false, "Whether to print stack traces on some errors"],
@@ -42,10 +48,6 @@ module Puppet
this directory can be removed without causing harm (although it
might result in spurious service restarts)."
},
- :rundir => { :default => "/var/run/puppet",
- :mode => 01777,
- :desc => "Where Puppet PID files are kept."
- },
:statefile => { :default => "$statedir/state.yaml",
:mode => 0660,
:desc => "Where puppetd and puppetmasterd store state associated
@@ -59,6 +61,10 @@ module Puppet
:owner => "root",
:desc => "Where SSL certificates are kept."
},
+ :rundir => { :default => rundir,
+ :mode => 01777,
+ :desc => "Where Puppet PID files are kept."
+ },
:genconfig => [false,
"Whether to just print a configuration to stdout and exit. Only makes
sense when used interactively. Takes into account arguments specified