diff options
author | nimisha <nimisha.sharad@msystechnologies.com> | 2017-05-04 16:20:14 +0530 |
---|---|---|
committer | Bryan McLellan <btm@loftninjas.org> | 2017-05-31 14:20:20 -0500 |
commit | 8a1539d0c29426383df0e7e548dfdb38204720d7 (patch) | |
tree | 43cea3ca423b53baa3e2ba953843ffbd0a667977 | |
parent | 734774fcbb012533f99c9aa67ca1e6b54f922137 (diff) | |
download | chef-8a1539d0c29426383df0e7e548dfdb38204720d7.tar.gz |
Calling reconfigure outside trap('HUP')
Signed-off-by: nimisha <nimisha.sharad@msystechnologies.com>
-rw-r--r-- | lib/chef/application.rb | 5 | ||||
-rw-r--r-- | lib/chef/application/client.rb | 6 |
2 files changed, 6 insertions, 5 deletions
diff --git a/lib/chef/application.rb b/lib/chef/application.rb index 096ce9c392..41c1111f37 100644 --- a/lib/chef/application.rb +++ b/lib/chef/application.rb @@ -72,11 +72,6 @@ class Chef trap("QUIT") do Chef::Log.info("SIGQUIT received, call stack:\n " + caller.join("\n ")) end - - trap("HUP") do - Chef::Log.info("SIGHUP received, reconfiguring") - reconfigure - end end end diff --git a/lib/chef/application/client.rb b/lib/chef/application/client.rb index 3765821993..8926077117 100644 --- a/lib/chef/application/client.rb +++ b/lib/chef/application/client.rb @@ -412,6 +412,11 @@ class Chef::Application::Client < Chef::Application Chef::Log.info("SIGUSR1 received, waking up") SELF_PIPE[1].putc(IMMEDIATE_RUN_SIGNAL) # wakeup master process from select end + + trap("HUP") do + Chef::Log.info("SIGHUP received, reconfiguring") + $reconfigure = true + end end end @@ -438,6 +443,7 @@ class Chef::Application::Client < Chef::Application private def interval_run_chef_client + reconfigure if $reconfigure if Chef::Config[:daemonize] Chef::Daemon.daemonize("chef-client") |