Skip to content
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

Updating consul version does not restart consul #251

Closed
joerocklin opened this issue Dec 9, 2015 · 7 comments · Fixed by #291
Closed

Updating consul version does not restart consul #251

joerocklin opened this issue Dec 9, 2015 · 7 comments · Fixed by #291
Assignees
Milestone

Comments

@joerocklin
Copy link
Contributor

Not sure if this is a bug for poise, libartifact, or the use of them both here. What I'm seeing is: when running the cookbooks and doing an upgrade from 0.5.2 -> 0.6.0 (binary install), the binary gets updated but the service isn't restarted. It looks like there's a subscription on config file changes, but there's no config file change in this process!

I looked to see if there was a convenient way to subscribe/notify on a binary update, but I'm not very familiar with poise or libartifact, and the fact that it's updating the binary inside an LWRP complicates things a bit.

@johnbellone johnbellone added the bug label Dec 9, 2015
@johnbellone johnbellone added this to the 1.4 milestone Dec 9, 2015
@Ginja
Copy link
Contributor

Ginja commented Dec 10, 2015

I noticed this as well.

+1

@johnbellone
Copy link
Contributor

I have tracked this down with some of our other cookbooks. I'm going to test a fix.

@johnbellone johnbellone self-assigned this Jan 19, 2016
@johnbellone johnbellone removed this from the 1.4 milestone Feb 5, 2016
@kamaradclimber
Copy link
Contributor

hello @johnbellone,

do you need help for a fix on this issue?

In the meantime I have added a simple restart in my wrapper cookbook:

log 'Trigger consul restart because of version update' do
  notifies :restart, "consul_service[#{node['consul']['service_name']}]"
  only_if do
  cmd = case node['platform']
          when 'windows'
            Mixlib::ShellOut.new('"C:\Program Files\consul\consul.exe" info')
          else
            Mixlib::ShellOut.new("consul info")
          end

    cmd.run_command
    cmd.error!
    version = cmd.stdout.lines.
      select { |l| l =~ /version/ && !(l =~ /go/) }.
      first.gsub(/.* = ([0-9.]+)$/, '\1').strip
    version != node['consul']['version']
  end 
end

@johnbellone
Copy link
Contributor

Some help would definitely be appreciated!

@gdavison
Copy link
Contributor

I've noticed recently that, at least on Windows, it's not restarting on config file changes, either. Not sure if this is related.

Steps:

  1. Install
  2. Consul starts
  3. Tweak config attributes
  4. Re-run chef
  5. Doesn't restart

@scalp42
Copy link
Contributor

scalp42 commented Feb 19, 2016

Any chance to make the restart optional please?

@lock
Copy link

lock bot commented Apr 25, 2020

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Apr 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants