/etc/rc.d/rc.local配置文件
/etc/rc.d/rc.loacl配置文件
·
/etc/rc.d/rc.local配置文件
/etc/rc.d/rc.local配置文件
需要再系统启动时运行的工作,写入/etc/rc.d/rc.local配置文件即可。
/etc/rc.local与/etc/rc.d/rc.local的关系
/etc/rc.local —>rc.d/rc.local
(/etc/rc.local的链接文件指向/etc/rc.d/rc.local)
配置文件内容
[root@localhost ~]#vi /etc/rc.d/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
#默认会touch这个文件,每次系统启动时都会touch这个文件,这个文件的修改时间就是系统的启动时间
#写入想要启动系统并运行的语句
#例1:
/etc/rc.d/init.d/httpd start
#如果写入RPM包安装的apache服务的启动命令,apache服务就会在开机时自动启动
#例2:
[ -f /usr/local/gse/proxy/bin/gsectl ] && /usr/local/gse/proxy/bin/gsectl start > /var/log/gse_start.log 2>&1
#某系统的开机自启设置
更多推荐
已为社区贡献1条内容
所有评论(0)