summaryrefslogtreecommitdiffstats
path: root/lib/puppet/application/puppetqd.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/puppet/application/puppetqd.rb')
-rw-r--r--lib/puppet/application/puppetqd.rb22
1 files changed, 12 insertions, 10 deletions
diff --git a/lib/puppet/application/puppetqd.rb b/lib/puppet/application/puppetqd.rb
index 9d2740a81..05bb21fe9 100644
--- a/lib/puppet/application/puppetqd.rb
+++ b/lib/puppet/application/puppetqd.rb
@@ -5,11 +5,14 @@ require 'puppet/resource/catalog'
require 'puppet/indirector/catalog/queue'
Puppet::Application.new(:puppetqd) do
- extend Puppet::Daemon
-
should_parse_config
+ attr_accessor :daemon
+
preinit do
+ @daemon = Puppet::Daemon.new
+ @daemon.argv = ARGV.dup
+
# Do an initial trap, so that cancels don't get a stack trace.
trap(:INT) do
$stderr.puts "Cancelling startup"
@@ -22,8 +25,6 @@ Puppet::Application.new(:puppetqd) do
}.each do |opt,val|
options[opt] = val
end
-
- @args = {}
end
option("--debug","-d")
@@ -37,9 +38,8 @@ Puppet::Application.new(:puppetqd) do
Puppet.notice "Processing queued catalog for %s" % catalog.name
catalog.save
end
- daemonize if Puppet[:daemonize]
- while true do sleep 1000 end
+ sleep_forever()
end
# Handle the logging settings.
@@ -52,10 +52,6 @@ Puppet::Application.new(:puppetqd) do
Puppet::Util::Log.level = :info
end
end
-
- unless options[:setdest]
- Puppet::Util::Log.newdestination(:syslog)
- end
end
setup do
@@ -70,5 +66,11 @@ Puppet::Application.new(:puppetqd) do
end
Puppet::Resource::Catalog.terminus_class = :active_record
+
+ daemon.daemonize if Puppet[:daemonize]
+ end
+
+ def sleep_forever
+ while true do sleep 1000 end
end
end