4 simple steps to run JBoss server on startup in Ubuntu
Follow these simple steps to configure and run JBoss AS 7 as a sevice in Ubuntu. I have verified this on Ubuntu 14.04. It should also work in other versions also. Follow the following configurations steps, you can directly copy the code and use it in your environment.
Step 1: Create a file in /etc/init.d/, which is the script for the service. This folder contains all the scripts that should run on startup of a linux instance.
sudo nano /etc/init.d/jbossas7
Step 2: Insert the following code, which defines the start and stop commands for the service. You should replace the variable JBOSS_HOME with your local JBoss install folder. You should replace the variable SERVER_IP with your server's IP address in proper format x.x.x.x. This will run the JBoss as a service using the root user, you can change the commands accordingly to run as a different user.