startx 启动过程

来源:互联网 发布:js if判断多个条件 编辑:程序博客网 时间:2024/04/30 17:22

/usr/bin/startx,脚本

 20 userclientrc=$HOME/.xinitrc 21 sysclientrc=/etc/X11/xinit/xinitrc 22  23  24 userserverrc=$HOME/.xserverrc 25 sysserverrc=/etc/X11/xinit/xserverrc 26 defaultclient=xterm 27 defaultserver=/usr/bin/X 
。。。。。
197 xinit "$client" $clientargs -- "$server" $display $serverargs
</pre><pre name="code" class="plain">=》<span style="color:#ff0000;">startx调用xinit启动X</span>
<span style="white-space:pre"></span>默认参数优先级$HOME,/etc/X11/xinit下的xinitrc,xserverrc
</pre><h2>/usr/bin/xinit,二进制</h2><div><span style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px">功能:启动一个 </span><span style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px">X </span><span style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px">服务器,同时启动一个基于 </span><span style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px">X </span><span style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px">的应用程序</span></div><div><span style="color:rgb(51,51,51); font-family:Arial; font-size:14px; line-height:26px"></span></div><h2><span style="font-family:Arial; color:#333333"><span style="font-size:14px; line-height:26px">流程分析</span></span></h2><div><span style="font-family:Arial; color:#333333"><span style="font-size:14px; line-height:26px">假设没有$HOME下的配置,存在如下配置</span></span><span style="color:rgb(51,51,51); font-size:14px; line-height:26px; font-family:Arial">/etc/X11/xinit/xinitrc ,</span><span style="color:rgb(51,51,51); font-size:14px; line-height:26px; font-family:Arial">/etc/X11/xinit/xserverrc </span></div><div><span style="font-family:Arial; color:#333333"><span style="font-size:14px; line-height:26px"></span></span><pre name="code" class="html">xx@xx$cat /etc/X11/xinit/xinitrc #!/bin/bash# $Xorg: xinitrc.cpp,v 1.3 2000/08/17 19:54:30 cpqbld Exp $# /etc/X11/xinit/xinitrc## global xinitrc file, used by all X sessions started by xinit (startx)# invoke global X session script. /etc/X11/Xsession
</pre><pre name="code" class="html">xx@xx$cat /etc/X11/xinit/xserverrc #!/bin/sh# $Id: xserverrc 189 2005-06-11 00:04:27Z branden $exec /usr/bin/X11/X -nolisten tcp


$ startx
</pre><pre name="code" class="html">197 xinit "$client" $clientargs -- "$server" $display $serverargs 实际上就是
xinit <span style="font-family: Arial;">. /etc/X11/Xsession </span>-- <span style="font-family: Arial;">exec /usr/bin/X11/X -nolisten tcp</span> :0