请教Deepin 2014.2中 rc.local的执行时序?
Tofloor
poster avatar
maokewu
deepin
2015-01-20 17:53
Author
目前Deepin Linux仅支持单独的DNS指向,而我们的办公网络通过防火墙与互联网隔离,因而需要办公网络的DNS和互联网的DNS,因而需要每次开机启动后,通过手工修改resolv.conf文件来达到目的,非常麻烦,因此我将: echo  -e  "nameserver 222.172.200.68\nnameserver  x.x.x.x\nsearch 61.166.150.123"  >  /etc/resolv.conf这条命令写入rc.local中,希望系统启动时自动修改resolv.conf的目的,但未获得成功。是因为Deepin 2014.2的控制中心初始化resolv.conf文件的执行时序在rc.local之后吗?
Reply Favorite View the author
All Replies
maokewu
deepin
2015-01-22 22:37
#1
Deepin的工程师没空浏览论坛吗?
Reply View the author
maokewu
deepin
2015-01-23 00:08
#2
deepin开机貌似已经不执行rc.local了吧?
是的,我之前用过的Linux,开机到处理了用户登录后,会执行rc.local中的脚本,帮了我很大的忙。使用Deepin后,我发现Deepin每次开机都会初始化resolv.conf文件,导致手工配置resolv.conf的DNS设置失效,因而尝试使用rc.local来解决。显然,rc.local要么没有执行,要么在控制中心初始化resolv.conf之前执行。如果是这样的话,就行不通了。
Reply View the author
MattD
deepin
2015-01-23 00:19
#3
resolv.conf被网络管理模块锁定托管了,所以不会生效,NetworkManager也会这么做。
要改DNS的话,只能在网络管理里面改。
Reply View the author
maokewu
deepin
2015-01-23 00:36
#4
resolv.conf被网络管理模块锁定托管了,所以不会生效,NetworkManager也会这么做。要改DNS的话,只能在网络管理里面改。
但网络管理仅支持一个DNS指向,我以其在控制中心的网络管理频繁地修改DNS,不如手工在终端执行sudo  echo  -e  "nameserver 222.172.200.68\nnameserver X.X.X.X\nsearch 61.166.150.123" > /etc/resolv.conf这样的命令。
Reply View the author
listenerri
deepin
2015-01-23 00:43
#5
rc.local有效
Reply View the author
MattD
deepin
2015-01-23 00:49
#6
[quote]resolv.conf被网络管理模块锁定托管了,所以不会生效,NetworkManager也会这么做。要改DNS的话,只能在网络管理里面改。
但网络管理仅支持一个DNS指向,我以其在控制中心的网络管理频繁地修改DNS,不如手工在终端执行sudo  echo  -e  "nameserver 222.172.200.68\nnameserver X.X.X.X\nsearch 61.166.150.123" > /etc/resolv.conf这样的命令。[/quote]
上mantis提需求吧,或者你愿意的话干脆写脚本来实现。
Reply View the author
liangrui
deepin
2015-01-23 01:11
#7
Reply View the author
maokewu
deepin
2015-01-23 01:21
#8
http://wiki.linuxdeepin.com/index.php?title=%E7%B3%BB%E7%BB%9F%E5%90%AF%E5%8A%A8%E6%B5%81%E7%A8%8B
可以去看看
wiki.linuxdeepin.com里讲的是Linux一般情况下的加载过程,如果按那里讲的启动过程,我把echo -e "nameserver 222.172.200.68\nnameserver X.X.X.X\nsearch 61.166.150.123" > /etc/resolv.conf这条命令放入rc.local,应该能够执行。但Deepin 2014.2可能将rc.local废弃了。
Reply View the author