-
Notifications
You must be signed in to change notification settings - Fork 210
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't consider opscode-chef-mover service status when checking ha-status #536
Conversation
@@ -94,6 +94,9 @@ | |||
ha_services = Dir.chdir(running_config['runit']['sv_dir']){Dir.glob('**/keepalive_me').map{|f| File.dirname(f)}}.sort | |||
|
|||
get_all_services.sort.each do |service_name| | |||
# opscode-chef-mover service is only used during an upgrade, and does not need to be running all of the time | |||
next if service_name.eql? "opscode-chef-mover" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may want to use omnibus-ctl
's concept of hidden services here. In that case, this check would become:
next if hidden_services.include?(service_name)
Thanks! This is a good improvement, I left a minor comment about using the hiddent_services array that omnibus-ctl already provides. |
@stevendanna I can change the PR to use hidden_services array. But can you please explain to me how this array becomes available to the ha.rb script? The only reference to it I found is here: chef-server/omnibus/files/private-chef-cookbooks/private-chef/attributes/default.rb Line 24 in 003067d
But to be perfectly honest I didn't really understand how ha.rb script was able to leverage the get_all_services array either. |
@poliva83 Happy to try to explain. TL;DR: You have access to any instance method in the Omnibus::Ctl class. When we load a command definition like ha.rb, an instance of https://github.com/chef/omnibus-ctl/blob/master/lib/omnibus-ctl.rb#L172-L174 The add_command_under_category function used to define new https://github.com/chef/omnibus-ctl/blob/master/lib/omnibus-ctl.rb#L190 That new instance method, like any other instance method in that Both hidden_services and get_all_services are instance methods in https://github.com/chef/omnibus-ctl/blob/master/lib/omnibus-ctl.rb#L320 which is why you have access to them here. |
…when checking ha-status. This is based on assumption the opscode-chef-mover service is only used during an upgrade, and does not need to be running all of the time.
@stevendanna Thanks for explanation, things are more clear now. I tested and updated my pull request. Should be good now. |
:+1 This looks good to merge. |
Don't consider opscode-chef-mover service status when checking ha-status ChangeLog-Entry: [chef-server-ctl] Don't consider opscode-chef-mover service status when checking ha-status
Obvious fix for #361