当前位置: 首页 > 工具软件 > JBoss Wiki > 使用案例 >

Jboss 开机自动启动

慕兴平
2023-12-01

Jboss开机启动范例:

#!/bin/sh

### BEGIN INIT INFO

# Provides: jboss

# Required-Start: $local_fs $remote_fs $network $syslog

# Required-Stop: $local_fs $remote_fs $network $syslog

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Management of JBoss AS v7.x

### END INIT INFO

case "$1" in

start)

echo "Starting JBoss"

sudo -u javau sh /apps/xxx/scripts/TPS/startJBoss --instanceName=xxxx

;;

stop)

echo "Stopping JBoss"

sudo -u javau sh /apps/xxx/scripts/TPS/stopJBoss --instanceName=xxxxx

;;

log)

echo "Showing server.log..."

tail -1000f /apps/xxx/logs/jboss-eap/700/TPS/xxxxx/server.log

;;

*)

echo "Usage: /etc/init.d/jboss {start|stop|log}"

exit 1

;; esac

exit 0

如果不想丢失环境变量,可以使用sudo -i -u

refer to https://developer.jboss.org/wiki/HowToInstallJBossAS7AsALinuxService
refer to https://blog.csdn.net/cds86333774/article/details/51165361
refer to https://blog.csdn.net/qq_25821067/article/details/79120222

 类似资料: