summaryrefslogtreecommitdiffstats
path: root/lib/puppet/daemon.rb
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 07:30:14 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-03-02 07:30:14 +0000
commit95856eaaf02361ff597ca2c85e51cf141fe81280 (patch)
treedb31ba74ce65523fa9dcd4d1cae0cd75c55a4395 /lib/puppet/daemon.rb
parentff1df8e1aef99dbdc222c5d5d808494fd08e7f83 (diff)
downloadpuppet-95856eaaf02361ff597ca2c85e51cf141fe81280.tar.gz
puppet-95856eaaf02361ff597ca2c85e51cf141fe81280.tar.xz
puppet-95856eaaf02361ff597ca2c85e51cf141fe81280.zip
Okay, Puppet is now almost entirely capable of configuring itself. I have not yet added the extra tests to puppetmasterd to make sure it can start as a normal user, and the executables still fail some simple tests because they are producing output when they start (I will get rid of the output), but overall things look pretty good.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@965 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib/puppet/daemon.rb')
-rwxr-xr-xlib/puppet/daemon.rb36
1 files changed, 22 insertions, 14 deletions
diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb
index 9f91e183f..c4aeefadb 100755
--- a/lib/puppet/daemon.rb
+++ b/lib/puppet/daemon.rb
@@ -54,17 +54,20 @@ module Puppet
def httplog
args = []
+
# yuck; separate http logs
file = nil
- if self.is_a?(Puppet::Server)
+ Puppet.config.use(:puppet, :certificates, Puppet.name)
+ if Puppet.name == "puppetmasterd"
file = Puppet[:masterhttplog]
else
file = Puppet[:httplog]
end
+#
+# unless FileTest.exists?(File.dirname(file))
+# Puppet.recmkdir(File.dirname(file))
+# end
- unless FileTest.exists?(File.dirname(file))
- Puppet.recmkdir(File.dirname(file))
- end
args << file
if Puppet[:debug]
args << WEBrick::Log::DEBUG
@@ -72,12 +75,14 @@ module Puppet
log = WEBrick::Log.new(*args)
+
return log
end
# Read in an existing certificate.
def readcert
return unless @secureinit
+ Puppet.config.use(:puppet, :certificates)
# verify we've got all of the certs set up and such
if defined? @cert and defined? @key and @cert and @key
@@ -116,13 +121,15 @@ module Puppet
# storing the cert locally.
def requestcert
retrieved = false
+ Puppet.config.use(:puppet, :certificates)
# create the directories involved
- [Puppet[:certdir], Puppet[:privatekeydir], Puppet[:csrdir],
- Puppet[:publickeydir]].each { |dir|
- unless FileTest.exists?(dir)
- Puppet.recmkdir(dir, 0770)
- end
- }
+ # FIXME it's a stupid hack that i have to do this
+# [Puppet[:certdir], Puppet[:privatekeydir], Puppet[:csrdir],
+# Puppet[:publickeydir]].each { |dir|
+# unless FileTest.exists?(dir)
+# Puppet.recmkdir(dir, 0770)
+# end
+# }
if self.readcert
Puppet.info "Certificate already exists; not requesting"
@@ -188,6 +195,7 @@ module Puppet
# Create the pid file.
def setpidfile
+ Puppet.config.use(:puppet)
@pidfile = self.pidfile
if FileTest.exists?(@pidfile)
Puppet.info "Deleting old pid file"
@@ -199,10 +207,10 @@ module Puppet
end
end
- unless FileTest.exists?(Puppet[:rundir])
- Puppet.recmkdir(Puppet[:rundir])
- File.chmod(01777, Puppet[:rundir])
- end
+ #unless FileTest.exists?(Puppet[:rundir])
+ # Puppet.recmkdir(Puppet[:rundir])
+ # File.chmod(01777, Puppet[:rundir])
+ #end
Puppet.info "Setting pidfile to %s" % @pidfile
begin