Skip to content

Commit

Permalink
inserting distro constants into windows service messages
Browse files Browse the repository at this point in the history
Signed-off-by: Marc Chamberland <[email protected]>
  • Loading branch information
bobchaos committed Dec 5, 2019
1 parent 1befa58 commit e1a8a9d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/chef/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -389,8 +389,8 @@ def debug_stacktrace(e)
chef_stacktrace_out = "Generated at #{Time.now}\n"
chef_stacktrace_out += message

Chef::FileCache.store("chef-stacktrace.out", chef_stacktrace_out)
logger.fatal("Stacktrace dumped to #{Chef::FileCache.load("chef-stacktrace.out", false)}")
Chef::FileCache.store("#{Chef::Dist::SHORT}-stacktrace.out", chef_stacktrace_out)
logger.fatal("Stacktrace dumped to #{Chef::FileCache.load("#{Chef::Dist::SHORT}-stacktrace.out", false)}")
logger.fatal("Please provide the contents of the stacktrace.out file if you file a bug report")
logger.debug(message)
true
Expand Down
4 changes: 2 additions & 2 deletions lib/chef/application/windows_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class WindowsService < ::Win32::Daemon
option :config_file,
short: "-c CONFIG",
long: "--config CONFIG",
default: "#{ENV["SYSTEMDRIVE"]}/chef/client.rb",
default: "#{Chef::Config::etc_chef_dir}/client.rb",
description: "The configuration file to use for #{Chef::Dist::PRODUCT} runs."

option :log_location,
Expand All @@ -60,7 +60,7 @@ class WindowsService < ::Win32::Daemon
description: "Set the number of seconds to wait between #{Chef::Dist::PRODUCT} runs.",
proc: lambda { |s| s.to_i }

DEFAULT_LOG_LOCATION ||= "#{ENV["SYSTEMDRIVE"]}/chef/client.log".freeze
DEFAULT_LOG_LOCATION ||= "#{Chef::Config::c_chef_dir}/client.log".freeze

def service_init
@service_action_mutex = Mutex.new
Expand Down
6 changes: 3 additions & 3 deletions lib/chef/application/windows_service_manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,18 @@ class WindowsServiceManager
short: "-a ACTION",
long: "--action ACTION",
default: "status",
description: "Action to carry out on chef-service (install, uninstall, status, start, stop, pause, or resume)."
description: "Action to carry out on #{Chef::Dist::SHORT}-service (install, uninstall, status, start, stop, pause, or resume)."

option :config_file,
short: "-c CONFIG",
long: "--config CONFIG",
default: "#{ENV["SYSTEMDRIVE"]}/chef/client.rb",
default: "#{ChefConfig::Config::c_chef_dir}/client.rb",
description: "The configuration file to use for #{Chef::Dist::PRODUCT} runs."

option :log_location,
short: "-L LOGLOCATION",
long: "--logfile LOGLOCATION",
description: "Set the log file location for chef-service."
description: "Set the log file location for #{Chef::Dist::SHORT}-service."

option :help,
short: "-h",
Expand Down

0 comments on commit e1a8a9d

Please sign in to comment.