From a46a620486b106ffc8e653b48a1de58ca6a64933 Mon Sep 17 00:00:00 2001 From: luke Date: Tue, 29 Aug 2006 06:10:48 +0000 Subject: disabling chuser on os x, since it is broken with < ruby 1.8.5 git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1514 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/util.rb | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'lib') diff --git a/lib/puppet/util.rb b/lib/puppet/util.rb index 3352974e0..53ffe903a 100644 --- a/lib/puppet/util.rb +++ b/lib/puppet/util.rb @@ -98,6 +98,10 @@ module Util # Change the process to a different user def self.chuser + if Facter["operatingsystem"].value == "Darwin" + $stderr.puts "Ruby on darwin is broken; puppetmaster must run as root" + return + end if group = Puppet[:group] group = self.gid(group) unless group @@ -107,9 +111,14 @@ module Util begin Process.egid = group Process.gid = group - rescue - $stderr.puts "could not change to group %s" % group - exit(74) + rescue => detail + Puppet.warning "could not change to group %s: %s" % + [group.inspect, detail] + $stderr.puts "could not change to group %s" % group.inspect + + # Don't exit on failed group changes, since it's + # not fatal + #exit(74) end end end @@ -121,7 +130,6 @@ module Util end unless Process.uid == user begin - Process.euid = user Process.uid = user rescue $stderr.puts "could not change to user %s" % user -- cgit