linux(fedora)开机启动服务

tomcat一直在linux中无法随机启动服务,经过反复的修改终于在晚上调通。

vi /etc/rc.local

#!/bin/sh## This script will be executed *after* all the other init scripts.# You can put your own initialization stuff in here if you don't# want to do the full Sys V style init stuff.touch /var/lock/subsys/local#tomcatexport JDK_HOME=/usr/java/jdk1.6.0_22export JAVA_HOME=/usr/java/jdk1.6.0_22/usr/local/tomcat/bin/startup.sh#ssh/etc/init.d/sshd start#vsftpd/etc/init.d/vsftpd start

除了tomcat,其他的只要把启动参数写入rc.local就好。

相关推荐