To create a service in Ubuntu 12.04 Desktop or Ubuntu 12.04 Server for any program you simply need to place a file in the /etc/init.d/ folder that follows the pattern of the sample script below.
I was able to use the script below to create a service for the LifeRay portal program with which I am able to start,stop, check the status of, and check the logs for LifeRay. To start Liferay I can for example issue the command: service liferay start.
Advertisements