<div class="gmail_quote">2009/11/23 翁学天 <span dir="ltr"><<a href="mailto:wengxt@gmail.com">wengxt@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>如果是su操作的话,而不是su -,应该会继承环境变量的<br></div><div><br></div><div>其实我这里就算su -过去,也会得到以下结果,不知道为啥display也传过去了……可能和发行版有什么关系……</div><div>No protocol specified<br>kwrite: cannot connect to X server :0<br></div><div>这个才是错误</div><div>
<br></div><div>不过话说回来,我这里倒是无论kde,gtk程序都不能运行,错误相同,图形界面都要靠kdesu</div><br></blockquote><div><br></div><div>试了一下:</div><div>~% su</div><div><div>/home/grissiom# kate</div><div>No protocol specified</div><div>kate: cannot connect to X server :0.0</div>
<div><br></div><div>~% su -</div><div>Password:</div><div>darkstar# kate</div><div>kate: cannot connect to X server</div><div><br></div></div><div>两个的错误信息不一样哦~</div><div><br></div><div>发行版是 Slackware ;P</div><div> </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="gmail_quote">2009/11/23 vvoody <span dir="ltr"><<a href="http://wxj.g.sh" target="_blank">wxj.g.sh</a>@<a href="http://gmail.com" target="_blank">gmail.com</a>></span><div><div></div><div class="h5"><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">不对阿,普通用户su -之后root都不能运行X程序(无论gtk、kde)阿,因为DISPLAY没设置阿,会提示:<br>
root@slackware:~# xeyes<br>
Error: Can't open display:<br>
<br>
或<br>
root@slackware:~# firefox<br>
Error: no display specified<br>
<br>
root得export DISPLAY=:0.0,普通用户xhost +后root才能运行X程序。lz su后能运行X程序是什么情况?<br><br></blockquote></div></div></div></blockquote></div><br>-- <br>Cheers,<br>Grissiom<br>