summaryrefslogtreecommitdiffstats
path: root/bin/puppetd
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-10-28 05:39:59 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2005-10-28 05:39:59 +0000
commitb6c63f6924250a14e998f4256e81c30e950fed99 (patch)
tree8915ec8881f2389b208dfda27a12d11f69730398 /bin/puppetd
parent0ae5e3392597452acf6a2e9f0d4ac976b8ec9846 (diff)
downloadpuppet-b6c63f6924250a14e998f4256e81c30e950fed99.tar.gz
puppet-b6c63f6924250a14e998f4256e81c30e950fed99.tar.xz
puppet-b6c63f6924250a14e998f4256e81c30e950fed99.zip
Central logging now works, although there appear to be a few kinks to work out.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@732 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'bin/puppetd')
-rwxr-xr-xbin/puppetd29
1 files changed, 19 insertions, 10 deletions
diff --git a/bin/puppetd b/bin/puppetd
index 68cfad09d..98d64844f 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -138,8 +138,10 @@ begin
exit
when "--verbose"
Puppet[:loglevel] = :info
+ Puppet[:logdest] = :console
when "--debug"
Puppet[:loglevel] = :debug
+ Puppet[:logdest] = :console
when "--noop"
Puppet[:noop] = true
when "--ssldir"
@@ -151,12 +153,10 @@ begin
when "--port"
args[:Port] = arg
when "--logdest"
- # FIXME we should be able to have log.rb check the validity of the dst
- case arg
- when "syslog", "console", /^\//:
+ begin
Puppet[:logdest] = arg
- else
- $stderr.puts "Invalid log destination %s" % arg
+ rescue => detail
+ $stderr.puts detail.to_s
end
when "--vardir"
Puppet[:puppetvar] = arg
@@ -176,16 +176,28 @@ end
bg = false
-unless Puppet[:loglevel] == :debug or Puppet[:loglevel] == :info
- bg = true
+if Puppet[:loglevel] == :debug or Puppet[:loglevel] == :info
+ args[:Daemonize] = false
+else
+ args[:Daemonize] = true
end
args[:Server] = server
if fqdn
args[:FQDN] = fqdn
end
+
+logdest = args[:Server]
+
+if args.include?(:Port)
+ logdest += ":" + args[:Port]
+end
+
+Puppet[:logdest] = logdest
+
client = Puppet::Client::MasterClient.new(args)
+
unless client.readcert
if waitforcert
begin
@@ -206,9 +218,6 @@ unless client.readcert
end
if bg
- unless Puppet[:logdest] == :file
- Puppet[:logdest] = Puppet[:logfile]
- end
client.daemonize
end