How to troubleshoot service module? ( incorrectly reports successful start / RHEL 6 )

We have a custom written init script that never gets started when I do this:

A custom init script could have various issues. I suspect it might
not be demonizing correctly, though newer versions of Ansible more or
less force this issue.

Are you using the latest development Ansible?

Note -- There are some upgrades to the service module we were going to
do a point release for 1.1 on.

If you are having problems with reliable output from the service
status command, pattern= is a useful option.

A custom init script could have various issues. I suspect it might
not be demonizing correctly, though newer versions of Ansible more or
less force this issue.

Are you using the latest development Ansible?

No, I'm using 1.0. I will upgrade when I have some cycles.

If you are having problems with reliable output from the service
status command, pattern= is a useful option.

I will give that a try if other options fail.

My first clue: I modified the init script and it seems that 'state=started' first calls the init script with an argument of 'status', rather than 'start'. /var/log/messages shows that ansible-service did get called with 'state=started'

Any comments on that observation? I will try to poke further when I have time.

Sounds like you don't support status yet.

If you don't support status you must call the service module with the
pattern= argument.

It's explained a bit on the module doc section.

I checked the doc; it mentions "respond to the status command". What does that mean?

The init script in question *DOES* support status. It reports some running pid info, and then spits out some other diag info. Return code is 0.

OK. From some tests, I think 'respond to the status command' really means returns with non-zero if service is not running. Is this correct?

It would be worth clarifying in the docs.

Hmmm....

I personally don't think we need to document how to write a service
init script in our docs, per se, as that is pretty well standard to
the way that you have to write service init scripts so they work with
the 'service' command in the OS.