Redhat7 开机启动服务

#!/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

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

posted @ 2019-07-30 19:46  李欢欢  阅读(1596)  评论(2编辑  收藏  举报