转:ubuntu 配置开机启动vnc

【转】 ubuntu 配置开机启动vnc
2011-02-25 17:26
转载自 zhe_yun
最终编辑 babykick

如果在 /etc/init.d 中加入一个script,还须要制作相关的link
在 /etc/rc*.d 中。K 开头是kill,S 开头是start,数字顺序代表启动的顺。
update-rc.d 可以帮你的忙。

例:
在 /etc/init.d 中建立一个叫作zope 的script , 然后
update-rc.d zope defaults
就会产生以下链結:
Adding system startup for /etc/init.d/zope ...
/etc/rc0.d/K20zope -> ../init.d/zope
/etc/rc1.d/K20zope -> ../init.d/zope
/etc/rc6.d/K20zope -> ../init.d/zope
/etc/rc2.d/S20zope -> ../init.d/zope
/etc/rc3.d/S20zope -> ../init.d/zope
/etc/rc4.d/S20zope -> ../init.d/zope
/etc/rc5.d/S20zope -> ../init.d/zope

上面的设置适用于所有程序,下面就vnc来谈

在 /etc/init.d 目录下谢一个脚本vnc.sh,内容如下:
#!/bin/bash
#svnserve  startup
vncserve -d

然后执行:
update-rc.d vnc.sh defaults

只需两步就可以让vnc在系统启动时启动

查看开机启动配置:

chkconfig --list

chkconfig --add xxx

chkconfig --del xxx

posted @ 2011-03-25 23:27  babykick  阅读(2499)  评论(0编辑  收藏  举报