summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorPeter Huene <peter.huene@puppetlabs.com>2014-01-30 15:12:12 -0800
committerPeter Huene <peter.huene@puppetlabs.com>2014-01-30 15:22:20 -0800
commitab168ce94d0ce7db57757b2705394ec5bc02cf27 (patch)
treecf0a3364d756dc8645554c3c595da5dc4ae07401 /ext
parent2cfc3231b3ac4e14fa7093f641fc01de4368e260 (diff)
downloadpuppet-ab168ce94d0ce7db57757b2705394ec5bc02cf27.tar.gz
(PUP-1278) Updating Windows service event messages.
Changing the service startup message to not include the agent parameters. This will now only be printed when actually doing the agent run. Removing the "service running" message from the loop as this prints out repeatedly even if the service is paused. Moving determining the path to puppet to outside the run loop.
Diffstat (limited to 'ext')
-rwxr-xr-xext/windows/service/daemon.rb19
1 files changed, 9 insertions, 10 deletions
diff --git a/ext/windows/service/daemon.rb b/ext/windows/service/daemon.rb
index 3f05ee95f..84e4a283d 100755
--- a/ext/windows/service/daemon.rb
+++ b/ext/windows/service/daemon.rb
@@ -54,18 +54,16 @@ class WindowsDaemon < Win32::Daemon
# )
# end
- log_notice("Starting service with arguments: #{args}")
+ puppet = File.join(basedir, 'bin', 'puppet.bat')
+ unless File.exists?(puppet)
+ log_err("File not found: '#{puppet}'")
+ return
+ end
+ log_debug("Using '#{puppet}'")
- while running? do
- log_notice('Service running')
+ log_notice('Service started')
- puppet = File.join(basedir, 'bin', 'puppet.bat')
- unless File.exists?(puppet)
- log_err("File not found: '#{puppet}'")
- return
- end
-
- log_debug("Using '#{puppet}'")
+ while running? do
begin
runinterval = %x{ "#{puppet}" agent --configprint runinterval }.to_i
if runinterval == 0
@@ -78,6 +76,7 @@ class WindowsDaemon < Win32::Daemon
end
if state == RUNNING or state == IDLE
+ log_notice("Executing agent with arguments: #{args}")
pid = Process.create(:command_line => "\"#{puppet}\" agent --onetime #{args}", :creation_flags => Process::CREATE_NEW_CONSOLE).process_id
log_debug("Process created: #{pid}")
else