Previous versions of JBoss included a scripts (like jboss_init_redhat.sh) that could be copied to /etc/init.d in order to add it as a service - so it would star
jboss_init_redhat.sh
To print PID of command executed use shell variable $!. This variable will print PID of process executed.
case "$1" in start) echo "Starting JBoss AS 7.0.0" su --session-command "${JBOSS_HOME}/bin/standalone.sh >& /dev/null &" jboss echo $! > /tmp/jboss.pid ;;