There are several ways to start a Linux service, and sometimes it is not possible to use the Chkconfig command to run level settings and NTSYSV graphics run level settings, which can effectively resolve the problem.
Production environment:
OS: CentOS Release 6.7 (Final)
Web server: Apache tomcat/7.0.57
task: Linux starts automatically when you start Tomcat service.
The Linux auto-start service is configured as follows:
[Email protected] ~]#
[[Email protected]~]# cd/etc/rc.d
[Email protected]]# VI rc.local
#!/bin/sh
#
# This script would beexecuted *after* all the other init scripts.
# can put your owninitialization stuff in here if you don ' t
# want to does the full Sys vstyle init stuff.
Touch/var/lock/subsys/local
/usr/local/tomcat/bin/startup.sh #随系统自动启动tomcat Service
/usr/local/apache2/bin/apachectlstart
Start the Tomcat service manually as follows:
[Email protected] ~]#
[Email protected] ~]# Cd/usr/local/tomcat
[[email protected] tomcat] #cd bin
[Email protected] bin]#
[Email protected] bin]#./shutdown.sh #关闭tomcat服务
Using catalina_base:/usr/local/tomcat
Using Catalina_home:/usr/local/tomcat
Using Catalina_tmpdir:/usr/local/tomcat/temp
Using Jre_home:/usr/java/jdk1.7.0_71
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
[email protected] bin]#./startup.sh #启动tomcat服务
Using catalina_base:/usr/local/tomcat
Using Catalina_home:/usr/local/tomcat
Using Catalina_tmpdir:/usr/local/tomcat/temp
Using Jre_home:/usr/java/jdk1.7.0_71
Using CLASSPATH:/usr/local/tomcat/bin/bootstrap.jar:/usr/local/tomcat/bin/tomcat-juli.jar
Tomcat started.
This article is from the "Linux~dba~mba~eie" blog, make sure to keep this source http://sky9896.blog.51cto.com/2330653/1733086
How the Linux service automatically starts tomcat manually