summaryrefslogtreecommitdiffstats
path: root/bin/puppetmasterd
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-18 20:41:54 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-05-18 20:41:54 +0000
commitb3ea53cd99df84a93fe2f093d2224e711f49e5dd (patch)
tree848e3b2bc03865709e4b6e38f1536ebec99ba8b0 /bin/puppetmasterd
parent93771b7935e544630c3416fda928a3820c615df2 (diff)
downloadpuppet-b3ea53cd99df84a93fe2f093d2224e711f49e5dd.tar.gz
puppet-b3ea53cd99df84a93fe2f093d2224e711f49e5dd.tar.xz
puppet-b3ea53cd99df84a93fe2f093d2224e711f49e5dd.zip
Adding a lot of structure to puppet.rb to make it easier to manage multiple objects in a single process, including making it easy to add threads. Added some testing for all of that.
Also added a "runner" server, meant to be started within puppetd, so that clients can have runs triggered from a central host git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1212 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'bin/puppetmasterd')
-rwxr-xr-xbin/puppetmasterd25
1 files changed, 10 insertions, 15 deletions
diff --git a/bin/puppetmasterd b/bin/puppetmasterd
index 82dd45b99..6d6077f70 100755
--- a/bin/puppetmasterd
+++ b/bin/puppetmasterd
@@ -69,6 +69,12 @@
# Copyright (c) 2005 Reductive Labs, LLC
# Licensed under the GNU Public License
+# Do an initial trap, so that cancels don't get a stack trace.
+trap(:INT) do
+ $stderr.puts "Cancelling startup"
+ exit(0)
+end
+
require 'getoptlong'
require 'puppet'
require 'puppet/server'
@@ -234,25 +240,14 @@ if Puppet[:parseonly]
exit(0)
end
+Puppet.newservice(server)
+Puppet.settraps
+
if options[:daemonize]
server.daemonize
end
-
-[:INT, :TERM].each do |signal|
- trap(signal) do
- Puppet.notice "Caught #{signal}; shutting down"
- server.shutdown
- end
-end
-
Puppet.notice "Starting Puppet server version %s" % [Puppet.version]
-
-begin
- server.start
-rescue => detail
- Puppet.err "Could not start puppetmaster: %s" % detail
- exit(1)
-end
+Puppet.start
# $Id$