给定一个用户,如何控制启动图形会话后禁用哪些服务?

给定一个用户,如何控制启动图形会话后禁用哪些服务?

我还不熟悉upstart。据我所知,当我用自己的帐户启动 KDE 时,upstart会启动很多服务。但我有一些其他用户,我让他们使用,openbox因为我希望他们有一个只有一个浏览器的最小系统。因此,在他们登录后,比如说tty5,他们会运行:

$ ps aux | grep ^lightUser
lightUser      7430  0.0  0.0  41092  7432 tty5     S    01:06   0:00 -bash
lightUser     10038  0.0  0.0  34916  2596 tty5     R+   01:19   0:00 ps aux
lightUser     10039  0.0  0.0  28216   796 tty5     S+   01:19   0:00 grep --color=auto ^lightUser

在他们启动图形会话后,出现了无数的服务:

$ ps aux | ^lightUser
lightUser    1655  0.0  0.0  41084  7268 tty2     S+   01:04   0:00 -bash
lightUser    4139  0.0  0.0   4452  1644 tty2     S+   01:04   0:00 /bin/sh /usr/bin/startx
lightUser    4156  0.0  0.0  16008  2040 tty2     S+   01:04   0:00 xinit /etc/X11/xinit/xinitrc -- /etc/X11/xinit/xserverrc :1 -auth /tmp/serverauth.GhYql1LxgX
lightUser    4167  0.0  0.0  12972   836 tty2     S    01:04   0:00 /usr/bin/ck-launch-session /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch /bin/bash /home/lightUser/.Xsession
lightUser    4227  0.0  0.0  10624   316 ?        Ss   01:04   0:00 /usr/bin/ssh-agent /usr/bin/ck-launch-session /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch /bin/bash /home/lightUser/.Xsession
lightUser    4235  0.0  0.0  28892  3028 tty2     S    01:04   0:00 /bin/bash /home/lightUser/.Xsession
lightUser    4238  0.0  0.0  24448  1892 tty2     S    01:04   0:00 /usr/bin/dbus-launch --exit-with-session /usr/bin/im-launch /bin/bash /home/lightUser/.Xsession
lightUser    4239  0.0  0.0  39652  2772 ?        Ss   01:04   0:00 //bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
lightUser    4250  0.0  0.0 388616  8108 ?        Ssl  01:04   0:00 /usr/bin/ibus-daemon --daemonize --xim
lightUser    4260  0.1  0.4 218176 53072 tty2     Sl   01:04   0:01 Xephyr -fullscreen -screen 1920x1200 :11
lightUser    4261  0.0  0.0  76460  9192 tty2     S    01:04   0:00 blackbox
lightUser    4265  0.0  0.0 208908  5408 ?        Sl   01:04   0:00 /usr/lib/gvfs/gvfsd
lightUser    4269  0.0  0.0 294900  9236 ?        Sl   01:04   0:00 /usr/lib/gvfs/gvfsd-fuse /run/user/1002/gvfs -f -o big_writes
lightUser    4272  0.0  0.0 307936  7704 ?        Sl   01:04   0:00 /usr/lib/ibus/ibus-dconf
lightUser    4275  0.0  0.2 750008 27552 ?        Sl   01:04   0:00 /usr/lib/ibus/ibus-ui-gtk3
lightUser    4278  0.0  0.1 385120 15464 ?        Sl   01:04   0:00 /usr/lib/ibus/ibus-x11 --kill-daemon
lightUser    4285  0.0  0.0 367704  9652 ?        Sl   01:04   0:00 /usr/lib/at-spi2-core/at-spi-bus-launcher
lightUser    4291  0.0  0.0  39256  3360 ?        S    01:04   0:00 /bin/dbus-daemon --config-file=/etc/at-spi2/accessibility.conf --nofork --print-address 3
lightUser    4294  0.0  0.0 124920  4780 ?        Sl   01:04   0:00 /usr/lib/at-spi2-core/at-spi2-registryd --use-gnome-session
lightUser    4313  0.0  0.0 232084  7572 ?        Sl   01:04   0:00 /usr/lib/ibus/ibus-engine-simple
lightUser    4329  0.0  0.1 309028 21044 tty2     Sl   01:04   0:00 /usr/bin/openbox --startup /usr/lib/x86_64-linux-gnu/openbox-autostart OPENBOX
lightUser    4346  0.1  1.5 1100016 188280 tty2   Sl   01:04   0:01 /usr/lib/firefox/firefox
lightUser    4351  0.0  0.3 447220 40408 tty2     Sl   01:04   0:00 yakuake
lightUser    4358  0.0  0.3 525468 40976 tty2     Sl   01:04   0:00 konsole
lightUser    4359  0.0  0.0 306032  7468 tty2     Sl   01:04   0:00 /usr/lib/x86_64-linux-gnu/indicator-bluetooth/indicator-bluetooth-service
lightUser    4360  0.0  0.0 308012  7620 tty2     Sl   01:04   0:00 /usr/lib/x86_64-linux-gnu/indicator-power/indicator-power-service
lightUser    4363  0.0  0.0 479472  8484 tty2     Sl   01:04   0:00 /usr/lib/x86_64-linux-gnu/deja-dup/deja-dup-monitor
lightUser    4364  0.0  0.1 265876 22480 tty2     Sl   01:04   0:00 /usr/bin/python /usr/share/system-config-printer/applet.py
lightUser    4366  0.0  0.2 846672 27824 tty2     Sl   01:04   0:00 update-notifier
lightUser    4369  0.0  0.1 421844 13136 tty2     Sl   01:04   0:00 zeitgeist-datahub
lightUser    4370  0.0  0.2 1220688 29716 tty2    Sl   01:04   0:00 nm-applet
lightUser    4375  0.0  0.0  70556  6132 ?        S    01:04   0:00 /usr/lib/x86_64-linux-gnu/gconf/gconfd-2
lightUser    4390  0.0  0.0 323832 10436 ?        Sl   01:04   0:00 /usr/lib/gvfs/gvfs-udisks2-volume-monitor
lightUser    4393  0.0  0.0 289924  8368 ?        Sl   01:04   0:00 /usr/bin/zeitgeist-daemon
lightUser    4396  0.0  0.0 297848  6912 ?        S<l  01:04   0:00 /usr/bin/pulseaudio --start --log-target=syslog
lightUser    4441  0.0  0.0 298232  8292 ?        Sl   01:04   0:00 /usr/lib/gvfs/gvfs-afc-volume-monitor
lightUser    4446  0.0  0.0 224844  6264 ?        Sl   01:04   0:00 /usr/lib/gvfs/gvfs-gphoto2-volume-monitor
lightUser    4451  0.0  0.0 229812  7592 ?        Sl   01:04   0:00 /usr/lib/gvfs/gvfs-mtp-volume-monitor
lightUser    4459  0.0  0.1 178124 14936 ?        Ss   01:04   0:00 kdeinit4: kdeinit4 Running...
lightUser    4462  0.0  0.1 217052 18920 ?        S    01:04   0:00 kdeinit4: klauncher [kdeinit] --fd=8
lightUser    4468  0.0  0.2 303760 28032 ?        S    01:04   0:00 kdeinit4: kded4 [kdeinit]  
lightUser    4474  0.0  0.0 287240  6804 ?        Sl   01:04   0:00 /usr/lib/libunity-webapps/unity-webapps-service
lightUser    4488  0.0  0.2 301372 29380 ?        S    01:04   0:00 /usr/bin/kglobalaccel
lightUser    4490  0.0  0.0  40980  7120 pts/7    Ss+  01:04   0:00 /bin/bash
lightUser    4509  0.0  0.0  41004  7192 pts/11   Ss+  01:04   0:00 /bin/bash
lightUser    4516  0.0  0.2 412096 34220 ?        Sl   01:04   0:00 /usr/bin/knotify4
lightUser    4533  0.0  0.2 762628 25904 ?        Sl   01:04   0:00 /usr/lib/x86_64-linux-gnu/notify-osd
lightUser    4553  0.0  0.1 407532 18108 ?        Sl   01:04   0:00 /usr/bin/gnome-screensaver --no-daemon

Xephyr(出于某种原因,我希望它们与、blackbox和 一起运行openbox)。

我如何才能防止所有冗余服务无用地启动?我想它们不需要任何包含、、、、、、*bus*等的东西……notifyscreensaverlauncherzeitgeistpulseaudionm-applet

谢谢!

PS: 的lightUser~/.Xsession

Xephyr -fullscreen -screen 1920x1200 :11 &
exec blackbox &
sleep 4
DISPLAY=:11 /usr/bin/openbox-session

还:

$ lsb_release -d
Description:    Ubuntu 14.04.1 LTS

相关内容