This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
You need to write a shell script and add it to /etc/init.d, and you need to set run level (how you do that varies slightly between different Linux flavors - most of them provide GUI tools for doing this). JBoss AS comes with several such scripts, you could use one of those as a template.