Issues with service module

After some digging, it seems that the issue is related to the fact that I'm
backgrounding the process, which seems odd as should only use
service-command to start/stop the process(?)

The start function in the init-script looks like this:
daemon "/path/to/app/appname $OPTS >/dev/null 2>&1 &"

Having seen this before I suspect it's still not daemonizing correctly.

I installed and used daemonize which seems to have solved all problems for me.

Some of us were talking about an issue similar to this on IRC the
other day regarding the RabbitMQ and JBossAS init scripts. The
solution we came up with was:

action: command /bin/nohub /bin/service $foo start

Which is a functional, yet unsatisfying and hackish kludge.

I'm looking now at making something like this possible:

action: service nohup=True name=$foo ensure=started

"Try using the 'nohup' parameter when you have misbehaving init
scripts which don't detach correctly"

That would nohup the entire /sbin/service process which is most likely not preferable and could most likely lead to complications if unlucky.
I will stick with daemonize as it’s designed to deal with applications that can’t do this themselves as also seems to be available in most distributions (http://software.clapper.org/daemonize/).

I simply added “/usr/sbin/daemonize -u app_user /path/to/app/appname $OPTS” to my custom init-script to solve the problem.

Inclined to agree