I'm trying to configuring BaseX to run as a service on my server. The
basexserver command has a flag
-S whose functionality is listed as "start as service".
If I run
basexserver -S at the command line, it outputs
Server was started. and returns to the shell prompt, with the server running as a background process. If I then run
basexserver stop, it outputs
Server was stopped. and returns to the shell prompt, with the server process no longer running.
Now I want to make this into an upstart job (something which is new to me). I'm not clear on how to translate this start-and-stop interface into an upstart job, particularly with respect to the expect stanza. The Upstart Cookbook recommends a procedure for establishing the fork count of an application; this yielded the number 34, which is well outside the range of expected results. What's the best way to handle this?