What's the right way to run a program as a service?

I would like to run a grails server in the background, so that stating and stopping it would be done using:

sudo service my-server start
sudo service my-server stop

The grails server is currently executed using a shell script, which sets a few environment variables and runs grails.

What's the standard way to run this script as a service?

1 Answer

Either use Upstart (see ) or create a script in /etc/init.d (see e.g. here). The former is more modern and flexible, but the latter is easier.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like