summaryrefslogtreecommitdiffstats
path: root/bin/puppetd
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-14 00:14:56 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-02-14 00:14:56 +0000
commit19942633b69f04c6789ef08a04d434024e1bc334 (patch)
treeb0890fdaf0a0c4a756ebce9604a516d250bc49f9 /bin/puppetd
parent798b3be4cf1d703cd8559414922b296600db9b47 (diff)
downloadpuppet-19942633b69f04c6789ef08a04d434024e1bc334.tar.gz
puppet-19942633b69f04c6789ef08a04d434024e1bc334.tar.xz
puppet-19942633b69f04c6789ef08a04d434024e1bc334.zip
Adding --enable/--disable locking for puppetd. You can now disable puppetd from running by creating a lock file, which is useful if you are testing a configuration and want puppetd not to run for a bit.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@908 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'bin/puppetd')
-rwxr-xr-xbin/puppetd34
1 files changed, 34 insertions, 0 deletions
diff --git a/bin/puppetd b/bin/puppetd
index b6cb2535a..f61ee69f3 100755
--- a/bin/puppetd
+++ b/bin/puppetd
@@ -37,9 +37,24 @@
# Send all produced logs to the central puppetmasterd system. This currently
# results in a significant slowdown, so it is not recommended.
#
+# disable::
+# Disable working on the local system. This puts a lock file in place,
+# causing +puppetd+ not to work on the system until the lock file is removed.
+# This is useful if you are testing a configuration and do not want the central
+# configuration to override the local state until everything is tested and
+# committed.
+#
+# +puppetd+ exits after executing this.
+#
# debug::
# Enable full debugging.
#
+# enable::
+# Enable working on the local system. This removes any lock file, causing
+# +puppetd+ to start managing the local system again.
+#
+# +puppetd+ exits after executing this.
+#
# fqdn::
# Set the fully-qualified domain name of the client. This is only used for
# certificate purposes, but can be used to override the discovered hostname.
@@ -95,7 +110,9 @@ end
options = [
[ "--centrallogging", GetoptLong::NO_ARGUMENT ],
+ [ "--disable", GetoptLong::NO_ARGUMENT ],
[ "--debug", "-d", GetoptLong::NO_ARGUMENT ],
+ [ "--enable", GetoptLong::NO_ARGUMENT ],
[ "--fqdn", "-f", GetoptLong::REQUIRED_ARGUMENT ],
[ "--help", "-h", GetoptLong::NO_ARGUMENT ],
[ "--logdest", "-l", GetoptLong::REQUIRED_ARGUMENT ],
@@ -122,11 +139,18 @@ centrallogs = false
setdest = false
+enable = false
+disable = false
+
begin
result.each { |opt,arg|
case opt
# First check to see if the argument is a valid configuration parameter;
# if so, set it.
+ when "--disable"
+ disable = true
+ when "--enable"
+ enable = true
when "--centrallogging"
centrallogs = true
when "--help"
@@ -209,6 +233,16 @@ end
Puppet.notice "Starting Puppet client version %s" % [Puppet.version]
client = Puppet::Client::MasterClient.new(args)
+if enable
+ client.enable
+elsif disable
+ client.disable
+end
+
+if enable or disable
+ exit(0)
+end
+
unless client.readcert
if waitforcert
begin