I am trying to set up a Thin Ruby application server on my Ubuntu VPS. I have created a specific account, installed rbenv under it along with all gems.
I am looking for a convenient way to obtain the following objectives:
- Run my Thin Rack application under my non-privileged user account.
- Make the application run as a daemon
- Have the daemon run automatically whenever the system boots
- Make the daemon restartable
- Make the application accessible to Nginx through a unix domain socket.
Objective two and three are the trickiest. Is it possible to define scripts for a user to be run as that user whenever the system boots?