Here is how you run glassfish as a service on CentOS:
- Create a user glassfish (you can call it anything you want) under which Glassfish will run.
- Install glassfish in /home/glassfish.
- Create the startup script /etc/init.d/glassfish for glassfish.
- Install the service
#chmod +x /etc/init.d/glassfish
#chkconfig --add glassfish
#chkconfig --level 3 glassfish on
- Start glassfish.