summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 17:12:26 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 17:12:26 +0000
commit1a93c822667e6990b45f843e56d8976c51517671 (patch)
treeb7764e684b080f27158dfc7430ab30624db15568 /bin
parent95856eaaf02361ff597ca2c85e51cf141fe81280 (diff)
downloadpuppet-1a93c822667e6990b45f843e56d8976c51517671.tar.gz
Fixing #68. After tons and tons and tons of work, everything successfully configures itself, and the --genmanifest argument should actually work. User and group creation will not necessarily work everywhere (in particular, Puppet uses dependencies to create the group first, but Fedora complains on user creation if the group already exists), but file and directory creation should. The only downside is that there is a decent amount of extra information printed on daemon startup, as the daemon checks its config; this could maybe be seen as a bonus, though, I guess.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@966 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'bin')
-rwxr-xr-xbin/puppetmasterd11
1 files changed, 9 insertions, 2 deletions
diff --git a/bin/puppetmasterd b/bin/puppetmasterd
index 3ae74f73b..fed55d89f 100755
--- a/bin/puppetmasterd
+++ b/bin/puppetmasterd
@@ -164,8 +164,6 @@ Puppet.genmanifest
require 'etc'
-Puppet::Util.chuser
-
if Puppet::Log.level == :debug or Puppet::Log.level == :info or parseonly
args[:Daemonize] = false
else
@@ -212,6 +210,15 @@ rescue => detail
exit(1)
end
+if Process.uid == 0
+ begin
+ Puppet::Util.chuser
+ rescue => detail
+ $stderr.puts "Could not change user to %s: %s" % [Puppet[:user], detail]
+ exit(39)
+ end
+end
+
if Puppet[:parseonly]
# we would have already exited if the file weren't syntactically correct
exit(0)