debian上使用rc.local
习惯了FreeBSD和RedHat上使用/etc/rc.local 定制服务的自动启动,最近用Debian还真有些不习惯。以下是我搜集到的资料:在debian上创建rc.local文件。
创建文件: sudo touch /etc/init.d/rc.local 设置可执行: sudo chmod +x /etc/init.d/rc.local 用update-rc.d设置启动级别: sudo update-rc.d rc.local start 20 2 3 4 5 . stop 20 0 1 6 .
为了编辑方便,创建一个链接: sudo ln -s /etc/init.d/rc.local /etc/rc.local
cat /etc/rc.local
start apache
/home/apache/bin/apachectl start
重启一下,没有问题。
后记:Debian 下没有 rc.local ,不过有一个替代品,就是 /etc/init.d/bootmisc.sh 文件(可以将/etc/rc.local 链接过去) 大家有什么需要启动后运行的,尽管往里面塞 :-P
类似的:也是使用update-rc.d 将相应服务设置成启动就可以了。
最近新安装了一台服务器,操作系统使用debian 必须熟练使用的几个命令: apt-get install [packagename] apt-cache search [string]
以后升级使用: apt-get update apt-get dist-upgrade apt-get upgrade 就可以了
目前安装的包: apt-get install kernel-image-2.6.8-2-686 (2.4.x 缺省不支持1G内存 ) apt-get install libgdbm-dev apt-get install zlib1g-dev apt-get install libcurl3-dev apt-get install php4-domxml apt-get install libxml2-dev