How To Run Tomcat Server At Startup On Ubuntu Server

回覆文章
yehlu
Site Admin
文章: 3245
註冊時間: 2004-04-15 17:20:21
來自: CodeCharge Support Engineer

How To Run Tomcat Server At Startup On Ubuntu Server

文章 yehlu »

http://www.linuxandubuntu.com/home/how- ... ntu-server

/etc/init.d/tomcat9

代碼: 選擇全部

#!/bin/bash

### BEGIN INIT INFO
# Provides: tomcat9
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop Tomcat server
### END INIT INFO

PATH=/sbin:/bin:/usr/sbin:/usr/bin

start() {
sh /tomcat/bin/startup.sh
}

stop() {
sh /tomcat/bin/shutdown.sh
}

case $1 in
start|stop) $1;;
restart) stop; start;;
*) echo "Run as $0 "; exit 1;;

esac

代碼: 選擇全部

$ chmod 755 /etc/init.d/tomcat9
$ update-rc.d tomcat9 defaults
回覆文章

回到「tomcat」