diff options
Diffstat (limited to 'lib/chef/application')
-rw-r--r-- | lib/chef/application/client.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index 0834e5f037..706ba93ca0 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -2,7 +2,7 @@ # Author:: AJ Christensen (<aj@chef.io) # Author:: Christopher Brown (<cb@chef.io>) # Author:: Mark Mzyk (mmzyk@chef.io) -# Copyright:: Copyright 2008-2016, Chef Software, Inc. +# Copyright:: Copyright 2008-2018, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -228,8 +228,7 @@ class Chef::Application::Client < Chef::Application option :client_fork, :short => "-f", :long => "--[no-]fork", - :description => "Fork client", - :boolean => true + :description => "Fork client" option :recipe_url, :long => "--recipe-url=RECIPE_URL", @@ -362,6 +361,11 @@ class Chef::Application::Client < Chef::Application Chef::Config[:splay] = nil end + # supervisor processes are enabled by default for interval-running processes but not for one-shot runs + if Chef::Config[:client_fork].nil? + Chef::Config[:client_fork] = !!Chef::Config[:interval] + end + if !Chef::Config[:client_fork] && Chef::Config[:interval] && !Chef::Platform.windows? Chef::Application.fatal!(unforked_interval_error_message) end |