diff options
author | nimisha <nimisha.sharad@msystechnologies.com> | 2017-05-04 16:20:14 +0530 |
---|---|---|
committer | Bryan McLellan <btm@chef.io> | 2017-05-22 11:14:41 -0400 |
commit | 7da17fecf2298c28da6bb41e9bd4685f3ba5f658 (patch) | |
tree | c845029eb0432c5dd3a8b2199d350ea5050d5468 | |
parent | 5cab1ac5b2b45b426548425ed08d0807ea03e42a (diff) | |
download | chef-7da17fecf2298c28da6bb41e9bd4685f3ba5f658.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 c8dbd76019..18dc188343 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") |