summaryrefslogtreecommitdiff
path: root/files
diff options
context:
space:
mode:
authormh <mh@immerda.ch>2013-05-20 15:49:40 +0200
committermh <mh@immerda.ch>2013-05-20 15:49:40 +0200
commitee2d7ea220bed64304577aa3d926782d57c26f6d (patch)
tree9a78618554b191ca358cd0a87f11db669d3d9ddc /files
parent679ddb1731b895021f6ee028910fe80a8cb88e66 (diff)
update to latest config.ru
Diffstat (limited to 'files')
-rw-r--r--files/master/config.ru41
1 files changed, 24 insertions, 17 deletions
diff --git a/files/master/config.ru b/files/master/config.ru
index cec2a34..984017e 100644
--- a/files/master/config.ru
+++ b/files/master/config.ru
@@ -2,28 +2,35 @@
# SSL needs to be handled outside this, though.
# if puppet is not in your RUBYLIB:
-# $:.unshift('/opt/puppet/lib')
+# $LOAD_PATH.unshift('/opt/puppet/lib')
-$0 = "puppetmasterd"
-require 'puppet'
-
-# logs to file instead of syslog
-#Puppet::Util::Log.newdestination("/var/log/puppet/puppetmasterd.log")
+$0 = "master"
# if you want debugging:
-#ARGV << "--debug"
+# ARGV << "--debug"
ARGV << "--rack"
-# in some setups puppetmasterd doesn't seem to read the puppet.conf
-# config at startup, then you need to pass these options:
-ARGV << "--vardir" << "/var/lib/puppet"
-ARGV << "--ssldir" << "/var/lib/puppet/ssl"
-
-# if you use puppet-dashboard:
-#ARGV << "--reports" << "puppet_dashboard"
-
-require 'puppet/application/puppetmasterd'
+# Rack applications typically don't start as root. Set --confdir and --vardir
+# to prevent reading configuration from ~puppet/.puppet/puppet.conf and writing
+# to ~puppet/.puppet
+ARGV << "--confdir" << "/etc/puppet"
+ARGV << "--vardir" << "/var/lib/puppet"
+
+# NOTE: it's unfortunate that we have to use the "CommandLine" class
+# here to launch the app, but it contains some initialization logic
+# (such as triggering the parsing of the config file) that is very
+# important. We should do something less nasty here when we've
+# gotten our API and settings initialization logic cleaned up.
+#
+# Also note that the "$0 = master" line up near the top here is
+# the magic that allows the CommandLine class to know that it's
+# supposed to be running master.
+#
+# --cprice 2012-05-22
+
+require 'puppet/util/command_line'
# we're usually running inside a Rack::Builder.new {} block,
# therefore we need to call run *here*.
-run Puppet::Application[:puppetmasterd].run
+run Puppet::Util::CommandLine.new.execute
+