I'm porting some SysV-style service scripts for HBase (a java service) to upstart.
The sysv scripts don't call
java directly, but instead call
hbase-daemon.sh. This is a
start-stop-daemon-like tool that ships with the package which pulls in a lot of configuration and ultimately ends in a
nohup java ... & to actually run the process as a daemon.
Since the configuration logic in
hbase-daemon.sh is involved, I would rather not modify or rewrite it (to remove the
nohup) and instead have upstart call it directly.
This seems to be what the
expect clause is for, except in my case it isn't working. Even with
expect daemon (the two fork case), I end up tracking the wrong pid on service start. This suggests that my scenario is forking too much, or perhaps
nohup shouldn't be handled with
expect, or yet something else.
How can I use upstart to manage a service that expects to be started with a script that calls