在该目录/etc/rc.d/init.d/中

创建文件:jboss 内容如下

# cat /etc/rc.d/init.d/jboss
   #!/bin/bash
   # chkconfig: 2345 99 01
   # description: JBoss 3.2.3   case "$1" in
   start)
        su - root -c '/jboss/jboss/bin/run.sh &'
        ;;
   stop)
        su - root -c '/jboss/jboss/bin/shutdown.sh -S &'
        ;;
   *)
        echo "Usage: jboss { start | stop }"
        ;;
   esac

第二种方法:

在/etc/rc.d中的文件rc.local中:

加入可以自启动jboss和oracle

#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.touch /var/lock/subsys/local
su - root -c '/jboss/jboss/bin/run.sh &'
su - oracle -c '/u01/app/oracle/oracle/product/10.2.0/db_1/bin/lsnrctl start'
su - oracle -c '/u01/app/oracle/oracle/product/10.2.0/db_1/bin/dbstart start'