gentoo / 未分类 · 2012年5月30日

添加开机自动运行程序

通过/etc/init.d/local来控制是否在启动时进行加载
vim /etc/init.d/local and cat /etc/local.d/README
就知道里面说的是啥
总之 要自启动的文件放在下面这个目录
/etc/local.d/
#If a file in this directory is executable and it has a .start extension,
it will be run when the local service is started.
#要自启动,写成这个格式并放在这个目录就行了
/etc/local.d/*.start
eg
vim /etc/local.d/evan.start
#!/bin/bash
#by evan
xrandr --output VGA-0 --same-as LVDS --mode 1440x900
/sbin/route add -host 121.10.140.91 gw 192.168.23.1
echo 'nameserver 8.8.4.4' >/etc/resolv.conf

#同样道理,这个正好与自启动相反
/etc/local.d/*.stop;
上面是gentoo为例子的,下面这个链接就讲了很多个发行版
http://linux-wiki.cn/wiki/zh-hans/%E6%B7%BB%E5%8A%A0%E5%BC%80%E6%9C%BA%E8%87%AA%E5%8A%A8%E8%BF%90%E8%A1%8C%E7%A8%8B%E5%BA%8F