I have an application that runs in a user account (based on Plack) and requires an init script.
It looks as simple as "sudo $ user start_server ...". I just wrote an LSB script using start-stop-daemon and it is really awkward and verbose. This does not seem to be the right way.
After doing a little searching and looking at a log of examples, I'm still not sure what the best way to do this is, and there is no consistent manual that I found.
I am currently working with:
start-stop-daemon --background --quiet --start --pidfile $PIDFILE \
--make-pidfile --chuid $DAEMONUSER \
--exec $DAEMON -- $DAEMON_OPTS
With DAEMON and DAEMON_OPTS like:
DAEMON="/home/mediamogul/perl5/perlbrew/perls/current/bin/start_server"
DAEMON_OPTS="--port $PORT -- starman --workers $WORKERS /home/mediamogul/MediaMogul/script/mediamogul.psgi"
Then I need to configure how to detect the launch, because it is a perl script, so perl is displayed as a command, not "start_server".
( perlbrew , perl, perl )
? , .