GlassFish linux下配置服务并自动启动

时光怂恿深爱的人放手 提交于 2020-03-11 10:18:27

1、vi /etc/init.d/glassfish3

export AS_JAVA=/usr/local/jdk1.6.0_11

GLASSFISHPATH=/root/glassfish3/bin
export PASSWD=/root/glassfish3/bin/.passwd

case "$1" in
start)
echo "starting glassfish from $GLASSFISHPATH"
su - root $GLASSFISHPATH/asadmin start-domain
;;
status)
$0 start
;;
restart)
$0 stop
$0 start
;;
stop)

echo "stopping glassfish from $GLASSFISHPATH"
su - root $GLASSFISHPATH/asadmin stop-domain

;;
*)
echo $"usage: $0 {start|stop|restart|status}"
exit 3
;;
esac

2、sudo chmod +x /etc/init.d/glassfish3

3、vi /root/glassfish3/bin/.passwd

AS_ADMIN_PASSWORD=administration-password  

请将 administration-password修改成你自己的密码

4、chkconfig  glassfish3 on

5、chkconfig --list glassfish3 

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!