From 9cb68417670d6bc98caf1169af4ecafb59f4c14c Mon Sep 17 00:00:00 2001 From: Ethan Rowe Date: Thu, 30 Jul 2009 15:28:16 -0400 Subject: Fix 2239 (step four): Refactored Puppet::Daemon's stop/restart methods to set status flags appropriately in Puppet::Application, and removed call to now-deprecated @agent.configure_delayed_restart. This should get the restart and stop behavior for daemons and their agents working nicely with the new global process status interface of Puppet::Application. --- lib/puppet/daemon.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/daemon.rb b/lib/puppet/daemon.rb index 0f538fe44..b6dbf2665 100755 --- a/lib/puppet/daemon.rb +++ b/lib/puppet/daemon.rb @@ -1,6 +1,7 @@ require 'puppet' require 'puppet/util/pidlock' require 'puppet/external/event-loop' +require 'puppet/application' # A module that handles operations common to all daemons. This is included # into the Server and Client base classes. @@ -83,11 +84,8 @@ class Puppet::Daemon end def restart - if agent and agent.running? - agent.configure_delayed_restart - else - reexec - end + Puppet::Application.restart! + reexec unless agent and agent.running? end def reopen_logs @@ -107,9 +105,9 @@ class Puppet::Daemon # Stop everything def stop(args = {:exit => true}) - server.stop if server + Puppet::Application.stop! - agent.stop if agent + server.stop if server remove_pidfile() -- cgit