rc.local add the tomcat service startup command, but tomcat service does not start properly

 We encountered a problem a special pit.

Originally thought to add tomcat startup command in the rc.local file, the tomcat the post. On the other server directly before this operation is no problem, but very fortunately, now suddenly die.

Start Troubleshooting:

1. Determine /etc/rc.d/rc.local have executable permissions, and tomcat command to copy directly out of the execution is normal. Normally, this should normally be normal. Helpless, the next step

 

 

2. Then check the system startup log message, execute cat / var / log / messages | grep rc.local may find the following error. That java_home and jre_home are not set, and this is a must. This brings me to speculate before rc.local executed, the system environment variables / etc / profile Lane set no regular assignment

 

 3. Confirm whether the issue of access to the system environment variables, so we print variable in the rc.local (need to restart the server). You can see the print out of the argument is null, judicious

 

4. Thus, the system tried to re-execute the rc.local variable assignment. Add the red part of that is, the specific need to modify it according to their own java path

 

 The system variable assignment statements can be directly copied / etc / profile Lane java variable assignment

[root@99 ~]# tail -n 5 /etc/profile
JAVA_HOME=/usr/local/jdk
JRE_HOME=/usr/local/jdk/jre
CLASS_PATH=.:/$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH

 

5. Restart the server. Tomcat can see the normal boot from Kai

 

 

Digression: here comes to linux boot process issues, so say some of the more basic things still have to know what's

 

Guess you like

Origin www.cnblogs.com/biaopei/p/11589637.html