我已经在bare X上设置了Openbox和瘦登录管理器,全部安装在系统%d init上(在Gentoo上)。我在桌面上使用两个不同的终端模拟器,以便能够为我的rc.xml文件中的每个终端创建不同的行为(标准大小的lxterminal快照位于左上角,roxterm垂直最大化)。我更进一步,在我的.config/openbox/autostart文件中添加了一个条目,以便在登录时自动启动an终端。然后,我手动打开了另外两个of终端实例,以及roxterm。查看pstree输出:
systemd
├─acpid -f
├─agetty --noclear tty1
├─at-spi-bus-laun
│ ├─dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork--print-addres
│ └─2*[{at-spi-bus-laun}]
├─at-spi2-registr --use-gnome-session
│ └─{at-spi2-registr}
├─dbus-daemon --system --address=systemd: --nofork --nopidfile--systemd-activation
├─dbus-daemon --fork --print-pid 6 --print-address 8 --session
├─dbus-launch --exit-with-session /etc/X11/Sessions/openbox
├─dhcpcd -q --nobackground
├─lal -c blue -s 10 -b -f %c -w 152
├─lxterminal <----------(1)
│ ├─bash
│ │ └─htop
│ ├─bash
│ │ └─su
│ │ └─bash
│ │ └─grc /usr/lib/python-exec/python2.7/grc tail -f ...
│ │ ├─grcat /usr/lib/python-exec/python2.7/grcat conf.log
│ │ └─tail -f /var/log/emerge.log
│ ├─bash
│ │ └─su
│ │ └─bash
│ │ └─grc /usr/lib/python-exec/python2.7/grc tail -f /var/log/dmesg
│ │ ├─grcat /usr/lib/python-exec/python2.7/grcat conf.log
│ │ └─tail -f /var/log/dmesg
│ ├─gnome-pty-helpe
│ └─{lxterminal}
├─slim -nodaemon -s
│ ├─X -nolisten tcp -br -deferglyphs 16 vt07 -auth /var/run/slim.auth
│ └─sh /etc/X11/Sessions/openbox
│ └─openbox --startup /usr/libexec/openbox-autostart OPENBOX
│ ├─firefox
│ │ ├─plugin-containe /usr/lib64/nsbrowser/plugins/libflashplayer.so ...
│ │ │ └─6*[{plugin-containe}]
│ │ └─35*[{firefox}]
│ └─roxterm <------------------------(2)
│ ├─bash
│ │ └─pstree -a
│ ├─gnome-pty-helpe
│ └─{roxterm}
├─systemd --user
│ └─(sd-pam)
├─systemd-journal
├─systemd-logind
├─systemd-udevd
└─xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55我注意到lx末端(1)和我通过手动启动它而调用的其他bash实例不是瘦/X/openbox进程的子实例,比如roxterm(2)或firefox;而是它们的父系统直接。我不明白为什么来自Openbox自动启动的东西会产生一个不会是它的直接后代的进程。尽管如此,受一些“小部件”是如何在大爆炸下设置的启发,我修改了autostart,使其包含一个替代$(lxterminal) &,而不仅仅是lxterminal &。结果仍然在Openbox流程上下文之外,下面是相关部分:
├─sh /home/myuser/.config/openbox/autostart
│ └─lxterminal <----------------------(3)
│ ├─bash
│ ├─bash
│ │ └─pstree -a
│ ├─gnome-pty-helpe
│ └─{lxterminal}ps -aux输出的一部分,查看流程状态列(请参阅man中的代码)等等:
root 1 0.0 0.0 40008 3096 ? Ss 17:16 0:00 /usr/lib/systemd/systemd
...
root 3290 0.0 0.0 30048 1656 ? Ss 17:17 0:00 /usr/lib/systemd/systemd-logind
root 3291 0.0 0.0 4248 824 ? Ss 17:17 0:00 /usr/sbin/acpid -f
message+ 3292 0.0 0.0 21732 1568 ? Ss 17:17 0:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation
root 3299 0.0 0.0 19900 1104 tty1 Ss+ 17:17 0:00 /sbin/agetty --noclear tty1
user 3359 0.0 0.0 30916 2064 ? Ss 17:17 0:00 /usr/lib/systemd/systemd --user
user 3362 0.0 0.0 56820 1132 ? S 17:17 0:00 (sd-pam)
root 3820 0.0 0.0 0 0 ? S 17:31 0:00 [kworker/1:1]
root 3823 0.0 0.0 0 0 ? S 17:31 0:00 [kworker/3:0]
root 4644 0.0 0.0 0 0 ? S 18:09 0:00 [kworker/1:2]
root 4912 0.0 0.0 0 0 ? S 18:18 0:00 [kworker/1:0]
root 4918 0.0 0.0 0 0 ? S 18:18 0:00 [kworker/0:0]
root 4919 0.2 0.4 132660 17632 ? Ss 18:18 0:00 /usr/bin/slim -nodaemon -s
root 4921 2.6 0.8 132044 34176 tty7 Ss+ 18:18 0:05 /usr/bin/X -nolisten tcp -br -deferglyphs 16 vt07 -auth /var/run/slim.auth
user 4931 0.0 0.0 14804 1384 ? S 18:18 0:00 /bin/sh /etc/X11/Sessions/openbox
user 4961 0.0 0.0 24480 628 ? S 18:18 0:00 /usr/bin/dbus-launch --exit-with-session /etc/X11/Sessions/openbox
user 4962 0.0 0.0 21716 1068 ? Ss 18:18 0:00 /usr/bin/dbus-daemon --fork --print-pid 6 --print-address 8 --session
user 4963 0.1 0.2 108152 9484 ? S 18:18 0:00 /usr/bin/openbox --startup /usr/libexec/openbox-autostart OPENBOX
user 4973 0.0 0.0 31056 2896 ? S 18:18 0:00 xcompmgr -c -C -t-5 -l-5 -r4.2 -o.55
user 4974 0.0 0.0 35636 3764 ? S 18:18 0:00 lal -c blue -s 10 -b -f %c -w 152
user 4976 0.1 0.3 330660 12916 ? Sl 18:18 0:00 lxterminal
user 4978 0.0 0.0 14696 808 ? S 18:18 0:00 gnome-pty-helper
user 4979 0.0 0.0 23368 2200 pts/0 Ss 18:18 0:00 /bin/bash
user 4988 0.0 0.0 23368 2200 pts/1 Ss 18:18 0:00 /bin/bash
user 4996 0.0 0.0 23368 2252 pts/2 Ss 18:18 0:00 /bin/bash
user 5003 0.4 0.0 21668 1952 pts/0 S+ 18:18 0:00 htop
user 5004 0.2 0.4 300924 18704 ? Sl 18:19 0:00 roxterm
user 5006 0.0 0.0 258980 2972 ? Sl 18:19 0:00 /usr/libexec/at-spi-bus-launcher
user 5009 0.0 0.0 21612 1508 ? S 18:19 0:00 /usr/bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
user 5012 0.0 0.0 120304 3284 ? Sl 18:19 0:00 /usr/libexec/at-spi2-registryd --use-gnome-session
user 5014 0.0 0.0 14696 780 ? S 18:19 0:00 gnome-pty-helper
user 5015 0.0 0.0 23368 2316 pts/3 Ss 18:19 0:00 -bash
root 5027 0.0 0.0 59876 2020 pts/1 S 18:19 0:00 su
root 5030 0.0 0.0 23480 2292 pts/1 S 18:19 0:00 bash
root 5035 0.0 0.1 24904 4796 pts/1 S+ 18:19 0:00 /usr/bin/python2.7 /usr/lib/python-exec/python2.7/grc tail -f /var/log/emerge.log
root 5036 0.0 0.0 7292 608 pts/1 S+ 18:19 0:00 tail -f /var/log/emerge.log
root 5037 0.0 0.1 25180 4860 pts/1 S+ 18:19 0:00 /usr/bin/python2.7 /usr/lib/python-exec/python2.7/grcat conf.log
root 5039 0.0 0.0 59876 2020 pts/2 S 18:19 0:00 su
root 5042 0.0 0.0 23476 2292 pts/2 S 18:19 0:00 bash
root 5047 0.0 0.1 24904 4792 pts/2 S+ 18:19 0:00 /usr/bin/python2.7 /usr/lib/python-exec/python2.7/grc tail -f /var/log/dmesg
root 5048 0.0 0.0 7292 612 pts/2 S+ 18:19 0:00 tail -f /var/log/dmesg
root 5049 0.0 0.1 25180 4856 pts/2 S+ 18:19 0:00 /usr/bin/python2.7 /usr/lib/python-exec/python2.7/grcat conf.log
user 5051 10.6 5.7 901616 231196 ? Sl 18:19 0:13 /opt/firefox/firefox
root 5106 0.0 0.0 59876 2020 pts/3 S 18:20 0:00 su
root 5109 0.0 0.0 23488 2380 pts/3 S 18:20 0:00 bash
root 5181 0.0 0.0 20560 1304 pts/3 R+ 18:22 0:00 ps -aux发布于 2014-01-13 20:24:18
主要的实际实现是窗口管理器的后代继承窗口管理器的环境变量。这有助于处理密码密钥代理,如gpg代理或ssh代理,其中登录管理器启动代理,因此窗口管理器及其后代自动继承SSH_AGENT_PID和SSH_AUTH_SOCK环境变量。
您可以比较两个进程的/proc/PID/environ输出:
cat /proc/`pgrep openbox`/environ | xargs -0 -l1使用
cat /proc/`pgrep lxterminal`/environ | xargs -0 -l1xargs -0 -l1只需将environ的以空结尾的输出打印到多行。
发布于 2014-01-14 14:07:08
没有任何东西要求应用程序以任何方式与窗口管理器(如果有的话)相关,甚至不能在同一个操作系统上运行。
从一开始就设计了X窗口系统,使应用程序(即X11客户端)能够通过网络远程连接到X11服务器。
https://unix.stackexchange.com/questions/109094
复制相似问题