- From: "Julian C. Dunn" <
>
- To:
- Subject: [chef] Re: Service startup and error handling
- Date: Mon, 30 Dec 2013 13:38:11 -0500
It's also common to write "block until operational" logic for daemons
that take a while to start up and become functional. Example:
https://github.com/opscode-cookbooks/jenkins/blob/master/recipes/server.rb#L100
- Julian
On Mon, Dec 30, 2013 at 4:51 AM, Giovanni Toraldo
<
>
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
--
[ Julian C. Dunn
<
>
* Sorry, I'm ]
[ WWW:
http://www.aquezada.com/staff/julian * only Web 1.0 ]
[
gopher://sdf.org/1/users/keymaker/ * compliant! ]
[ PGP: 91B3 7A9D 683C 7C16 715F 442C 6065 D533 FDC2 05B9 ]
Archive powered by MHonArc 2.6.16.