关于服务开机启动的问题
資深大佬 : bfqymmt 7
OS:ubuntu 16 查了很多资料,重启后,还是不能开机启动。
/etc/init.d/tomcat chmod +x /etc/init.d/tomcat update-rc.d tomcat defaults
能正常使用 service tomcat start|stop
#!/bin/sh ### BEGIN INIT INFO # Provides: tomcat # Required-Start: $remote_fs $network # Required-Stop: $remote_fs $network # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short Description: the tomcat Java Application Server ### END INIT INFO export JAVA_HOME=/opt/jdk1.8.0_231 export JRE_HOME=$JAVA_HOME/jre export PATH=$PATH:$JAVA_HOME/bin export CLASSPATH=. export CATALINA_HOME=/opt/tomcat/ case "$1" in start) ${CATALINA_HOME}/bin/startup.sh echo 'tomcat start success' exit 0 ;; stop) ${CATALINA_HOME}/bin/shutdown.sh echo 'tomcat stop success' 略

大佬有話說 (7)