diff options
author | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-10 17:46:07 +0000 |
---|---|---|
committer | luke <luke@980ebf18-57e1-0310-9a29-db15c13687c0> | 2006-01-10 17:46:07 +0000 |
commit | 45ac512054af7cb8104cfa785102b67164d2cca4 (patch) | |
tree | 096a7f4a1e3e5719e10a02032a55f9fbdede4b52 /lib/puppet.rb | |
parent | 45c91e30c848011ff729505441fbf47a7f8df8fc (diff) | |
download | puppet-45ac512054af7cb8104cfa785102b67164d2cca4.tar.gz puppet-45ac512054af7cb8104cfa785102b67164d2cca4.tar.xz puppet-45ac512054af7cb8104cfa785102b67164d2cca4.zip |
Supporting puppetmasterd running as a non-root user, and doing some basic message cleanup
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@798 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet.rb')
-rw-r--r-- | lib/puppet.rb | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/puppet.rb b/lib/puppet.rb index 1b7a8f761..932ee9e1c 100644 --- a/lib/puppet.rb +++ b/lib/puppet.rb @@ -70,6 +70,7 @@ PUPPETVERSION = '0.10.0' alias :error :err @defaults = { + :name => $0.gsub(/.+#{File::SEPARATOR}/,''), :rrddir => [:puppetvar, "rrd"], :logdir => [:puppetvar, "log"], :bucketdir => [:puppetvar, "bucket"], @@ -88,18 +89,24 @@ PUPPETVERSION = '0.10.0' # and finally the simple answers, :server => "puppet", + :user => "puppet", + :group => "puppet", :rrdgraph => false, :noop => false, :parseonly => false, :puppetport => 8139, :masterport => 8140, } - if Process.uid == 0 - @defaults[:puppetconf] = "/etc/puppet" - @defaults[:puppetvar] = "/var/puppet" - else + + # If we're running the standalone puppet process as a non-root user, + # use basedirs that are in the user's home directory. + if @defaults[:name] == "puppet" and Process.uid != 0 @defaults[:puppetconf] = File.expand_path("~/.puppet") @defaults[:puppetvar] = File.expand_path("~/.puppet/var") + else + # Else, use system-wide directories. + @defaults[:puppetconf] = "/etc/puppet" + @defaults[:puppetvar] = "/var/puppet" end def self.clear |