[chef] Re: Re: Upgrade caused chef client to stop


Chronological Thread 
  • From: Daniel DeLeo < >
  • To:
  • Subject: [chef] Re: Re: Upgrade caused chef client to stop
  • Date: Fri, 11 Mar 2011 08:58:19 -0800

On Friday, March 11, 2011 at 3:56 AM, Ash Berlin wrote:

On 11 Mar 2011, at 09:29, Ash Berlin wrote:
So last night all my chef clients seem to finally pick up the upgrade to chef 0.9.14 (I guess this is when .14 got pushed to the opscode apt repo which i'm using)

Sadly they didn't upgrade cleanly:

[Thu, 10 Mar 2011 23:32:28 +0000] INFO: Upgrading package[chef] version from 0.9.12+dfsg-2 to 0.9.14+dfsg-1
[Thu, 10 Mar 2011 23:32:30 +0000] FATAL: SIGTERM received, stopping
[Thu, 10 Mar 2011 23:32:30 +0000] ERROR: Running exception handlers
[Thu, 10 Mar 2011 23:32:30 +0000] ERROR: Exception handlers complete

Thats it - after that point chef stopped running.

1) Why?
2) How do i stop it from happening again? ;)

-ash

I just noticed that apt-get update was failing with this error:

E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.

Which might implies it aborted part way through the update process when it SIGTERMed the old process.

How should I be upgrading chef using chef?

-ash
Right, I believe that the upgrade causes apt to restart chef-client. In order to update chef via apt with chef, you'll need to fork off a new process that can survive the chef process being killed. You would need to do something like this:

  fork do
    Process.setsid
    # code to upgrade the package
  end

  Chef::Log.info("Exiting for upgrade...")
  exit! 0

Clearly, not as nice as using the package resource, but you could maybe make a LWRP of it.

-- 
Dan DeLeo




Archive powered by MHonArc 2.6.16.

§