2010/5/16 Ante Karamatić <[email protected]>:
> Hi all
>
> I'm working on an OCF RA for upstart. In its current state, upstart
> doesn't return exit codes for 'start', 'stop' or 'status'. Or, to be
> precise, exit code is always 0.
>
> Exit codes weren't implemented since upstart knows a bit more states
> than just 'running' or 'not running', i.e. it knows distinction between
> running, but stopping and running.

Which is still no excuse for them not doing exit codes properly.
They should have just added a few more not thrown them out and made
automation that much harder.

I'm pretty sure that internally they're not using regex's to parse the
state of services :-/

> Never the less, it has exit statuses
> which are machine readable with grep/awk/whatever. Exit codes will be
> implemented in feature (probably in couple of months).
>
> So, to create an resource agent that would utilize upstart we could
> relay on greping the output of initctl commands or we could relay on dbus.
>
> Approach I've taken was to utilize python interface to dbus. Reason for
> this is that upstream prefers communication over dbus, as explained at
> http://upstart.ubuntu.com/wiki/DBusInterface.
>
> I should have this RA done very soon and my plan was to name it
> upstart-dbus, since it would depend on dbus.
>
> dbus isn't installed by default on ubuntu server and probably it isn't
> installed on other server distributions (correct me if I'm wrong). Would
> depending on dbus be a problem

I think I'd not make it a strict dependency, and instead make sure the
RA checked for dbus and produced OCF_NOT_INSTALLED if it wasn't
available.

> and if not, would python based RA be
> acceptable at all?

I think we're supposed to be language agnostic so I'd not imagine that
to be a problem.

Being a plugin is probably a better solution in the long term though,
since then we might be able to take advantage of the upstart events.
It also uses 0.00001% fewer characters to configure too I guess :-)

> I'm aware that it is a bit slower than just greping,
> but measured with time(1) worst result for 'status' was 0,05 seconds.
> _______________________________________________________
> Linux-HA-Dev: [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
> Home Page: http://linux-ha.org/
>
_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to