如题所述
1. èªå·±æ°å»ºä¸ä¸ªèæ¬,å¦centnet-service.sh
ç»è¿åé¢çå 个æ¥éª¤å,è¿ä¸ªèæ¬å¨å¼æºçæ¶åä¼æ§è¡,å¨è¿ä¸ªèæ¬éé¢å¯ä»¥åä½ å¼æºçæ¶åæ³æ§è¡çå½ä»¤,å¦å¯å¨tomcat,oracleçæå¡
2. å¨èæ¬ä¸è¾å ¥å¯å¨æå¡çå½ä»¤,å¦(å¼æºå¯å¨tomcat):
#!/bin/bashexport JDK_HOME=/home/java/jdk1.8.0_91export JAVA_HOME=/home/java/jdk1.8.0_91/home/tomcat/apache-tomcat-8.0.36/bin/startup.sh
3. æ§è¡å¦ä¸å½ä»¤,å°è¯¥èæ¬æ 记为å¯æ§è¡æ件(æ·»å å¯æ§è¡çæé)
chmod +x /home/centnet/centnet-service.sh
4. æ§è¡å¦ä¸å½ä»¤å°/etc/rc.d/rc.localææ 记为å¯æ§è¡æ件
å¨centos7ä¸,/etc/rc.d/rc.localæ件çæé被éä½äº,å¼æºçæ¶åæ§è¡å¨èªå·±çèæ¬æ¯ä¸è½èµ·å¨ä¸äºæå¡ç,æ§è¡ä¸é¢çå½ä»¤å¯ä»¥æ件æ 记为å¯æ§è¡çæ件
chmod +x /etc/rc.d/rc.local
5. æå¼/etc/rc.d/rc.localæ件,å¨æåé¢æ·»å å¦ä¸èæ¬
/home/centnet/centnet-service.sh
è¿æ ·,centnet-service.shè¿ä¸ªèæ¬å¨å¼æºçæ¶åå°±ä¼è¢«æ§è¡äº,以ååè¿éé¢åå¯å¨æå¡çå½ä»¤å°±å¯ä»¥äº
ç»è¿åé¢çå 个æ¥éª¤å,è¿ä¸ªèæ¬å¨å¼æºçæ¶åä¼æ§è¡,å¨è¿ä¸ªèæ¬éé¢å¯ä»¥åä½ å¼æºçæ¶åæ³æ§è¡çå½ä»¤,å¦å¯å¨tomcat,oracleçæå¡
2. å¨èæ¬ä¸è¾å ¥å¯å¨æå¡çå½ä»¤,å¦(å¼æºå¯å¨tomcat):
#!/bin/bashexport JDK_HOME=/home/java/jdk1.8.0_91export JAVA_HOME=/home/java/jdk1.8.0_91/home/tomcat/apache-tomcat-8.0.36/bin/startup.sh
3. æ§è¡å¦ä¸å½ä»¤,å°è¯¥èæ¬æ 记为å¯æ§è¡æ件(æ·»å å¯æ§è¡çæé)
chmod +x /home/centnet/centnet-service.sh
4. æ§è¡å¦ä¸å½ä»¤å°/etc/rc.d/rc.localææ 记为å¯æ§è¡æ件
å¨centos7ä¸,/etc/rc.d/rc.localæ件çæé被éä½äº,å¼æºçæ¶åæ§è¡å¨èªå·±çèæ¬æ¯ä¸è½èµ·å¨ä¸äºæå¡ç,æ§è¡ä¸é¢çå½ä»¤å¯ä»¥æ件æ 记为å¯æ§è¡çæ件
chmod +x /etc/rc.d/rc.local
5. æå¼/etc/rc.d/rc.localæ件,å¨æåé¢æ·»å å¦ä¸èæ¬
/home/centnet/centnet-service.sh
è¿æ ·,centnet-service.shè¿ä¸ªèæ¬å¨å¼æºçæ¶åå°±ä¼è¢«æ§è¡äº,以ååè¿éé¢åå¯å¨æå¡çå½ä»¤å°±å¯ä»¥äº
温馨提示:答案为网友推荐,仅供参考