[chef] Re: Service startup and error handling


Chronological Thread 
  • From: Sölvi Páll Ásgeirsson < >
  • To:
  • Subject: [chef] Re: Service startup and error handling
  • Date: Mon, 30 Dec 2013 10:41:54 +0000

Hi

All resources support 'retries' - maybe that helps you?

You could the do
execute 'foo' do
  retries 3
  retry_delay 3
...

Cheers
Sölvi


On Mon, Dec 30, 2013 at 9:51 AM, Giovanni Toraldo < " target="_blank"> > wrote:
Ohai Chefs,

when provisioning an EC2 micro instance to be used as a very basic
LAMP server, I get an error during the chef run when the database dump
should be loaded on the database (connection refused - port 3306
unreachable).

However, the subsequent run go fine, without any additional tricks
done manually.

I think that there is no assurance that between a service declared as
'started' (with the community mysql cookbook recipe) is really ready
to handle client requests (and I know, using a low resource instance
like the micro doesn't helps at all).

I am wondering if someone else got this problem, and if there is a way
to avoid to fix things on the next run (we are hot-deploying
web-applications, and it should be as fast as possible since an user
is waiting for it).

Can I trap the error raised by the execute resource (used to restore
the database dump), and retry it a few times before finally exit with
error?

Thanks!

--
Giovanni Toraldo
http://gionn.net




Archive powered by MHonArc 2.6.16.

§