手动启动 X 服务器后无法访问虚拟终端

手动启动 X 服务器后无法访问虚拟终端

我正在研究显示管理器。当 X 服务器已经启动时,我的显示管理器工作正常并且能够登录用户。然而,为了使其成为一个合适的显示管理器,它需要能够自行启动 X 服务器。

通过查看 的输出ps aux | grep X,并通过检查另一个轻量级显示管理器(SLiM)的源代码,我认为我的显示管理器应该执行以下命令:

/usr/bin/Xorg.bin :0 vt1

这是假设当前没有其他显示管理器/X 服务器正在运行。

问题是,当我的程序运行该命令或手动运行该命令时,我会切换到我指定的虚拟终端,然后系统“挂起”。我实际上不确定它是否挂起,或者只是我无法访问其他虚拟终端(我认为是后者)。这是我重新启动机器后的 Xorg.log:

[   631.692] 
X.Org X Server 1.16.3
Release Date: 2014-12-20
[   631.692] X Protocol Version 11, Revision 0
[   631.692] Build Operating System: Linux 3.18.1-1-ARCH x86_64 
[   631.692] Current Operating System: Linux arch 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64
[   631.692] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-linux root=UUID=5ba710b1-c7b7-410d-baed-d6670f818d56 rw quiet
[   631.692] Build Date: 29 December 2014  01:09:58PM
[   631.693]  
[   631.693] Current version of pixman: 0.32.6
[   631.693]    Before reporting problems, check http://wiki.x.org
    to make sure that you have the latest version.
[   631.693] Markers: (--) probed, (**) from config file, (==) default setting,
    (++) from command line, (!!) notice, (II) informational,
    (WW) warning, (EE) error, (NI) not implemented, (??) unknown.
[   631.693] (==) Log file: "/var/log/Xorg.0.log", Time: Sat Jan  3 23:38:54 2015
[   631.865] (==) Using config directory: "/etc/X11/xorg.conf.d"
[   631.865] (==) Using system config directory "/usr/share/X11/xorg.conf.d"
[   631.911] (==) No Layout section.  Using the first Screen section.
[   631.911] (==) No screen section available. Using defaults.
[   631.911] (**) |-->Screen "Default Screen Section" (0)
[   631.911] (**) |   |-->Monitor "<default monitor>"
[   631.918] (==) No device specified for screen "Default Screen Section".
    Using the first device section listed.
[   631.918] (**) |   |-->Device "Intel Graphics"
[   631.918] (==) No monitor specified for screen "Default Screen Section".
    Using a default monitor configuration.
[   631.918] (==) Automatically adding devices
[   631.918] (==) Automatically enabling devices
[   631.918] (==) Automatically adding GPU devices
[   631.996] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/OTF/".
[   631.996]    Entry deleted from font path.
[   631.996]    (Run 'mkfontdir' on "/usr/share/fonts/OTF/").
[   632.040] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/100dpi/".
[   632.040]    Entry deleted from font path.
[   632.040]    (Run 'mkfontdir' on "/usr/share/fonts/100dpi/").
[   632.040] (WW) `fonts.dir' not found (or not valid) in "/usr/share/fonts/75dpi/".
[   632.040]    Entry deleted from font path.
[   632.040]    (Run 'mkfontdir' on "/usr/share/fonts/75dpi/").
[   632.040] (==) FontPath set to:
    /usr/share/fonts/misc/,
    /usr/share/fonts/TTF/,
    /usr/share/fonts/Type1/
[   632.040] (==) ModulePath set to "/usr/lib/xorg/modules"
[   632.040] (II) The server relies on udev to provide the list of input devices.
    If no devices become available, reconfigure udev or disable AutoAddDevices.
[   632.047] (II) Loader magic: 0x818d80
[   632.047] (II) Module ABI versions:
[   632.047]    X.Org ANSI C Emulation: 0.4
[   632.047]    X.Org Video Driver: 18.0
[   632.047]    X.Org XInput driver : 21.0
[   632.047]    X.Org Server Extension : 8.0
[   632.051] (II) systemd-logind: took control of session /org/freedesktop/login1/session/c1
[   632.052] (II) xfree86: Adding drm device (/dev/dri/card1)
[   632.053] (II) systemd-logind: got fd for /dev/dri/card1 226:1 fd 10 paused 0
[   632.053] (II) xfree86: Adding drm device (/dev/dri/card0)
[   632.054] (II) systemd-logind: got fd for /dev/dri/card0 226:0 fd 11 paused 0
[   632.058] (--) PCI:*(0:0:2:0) 8086:0116:103c:185d rev 9, Mem @ 0xc0000000/4194304, 0xb0000000/268435456, I/O @ 0x00006000/64
[   632.058] (--) PCI: (0:1:0:0) 1002:6760:103c:185d rev 0, Mem @ 0xa0000000/268435456, 0xc6500000/131072, I/O @ 0x00005000/256, BIOS @ 0x????????/131072
[   632.058] (WW) Open ACPI failed (/var/run/acpid.socket) (No such file or directory)
[   632.059] (II) LoadModule: "glx"
[   632.097] (II) Loading /usr/lib/xorg/modules/extensions/libglx.so
[   632.114] (II) Module glx: vendor="X.Org Foundation"
[   632.114]    compiled for 1.16.3, module version = 1.0.0
[   632.114]    ABI class: X.Org Server Extension, version 8.0
[   632.114] (==) AIGLX enabled
[   632.114] (II) LoadModule: "intel"
[   632.114] (II) Loading /usr/lib/xorg/modules/drivers/intel_drv.so
[   632.161] (II) Module intel: vendor="X.Org Foundation"
[   632.161]    compiled for 1.16.3, module version = 2.99.917
[   632.161]    Module class: X.Org Video Driver
[   632.161]    ABI class: X.Org Video Driver, version 18.0
[   632.161] (II) intel: Driver for Intel(R) Integrated Graphics Chipsets:
    i810, i810-dc100, i810e, i815, i830M, 845G, 854, 852GM/855GM, 865G,
    915G, E7221 (i915), 915GM, 945G, 945GM, 945GME, Pineview GM,
    Pineview G, 965G, G35, 965Q, 946GZ, 965GM, 965GME/GLE, G33, Q35, Q33,
    GM45, 4 Series, G45/G43, Q45/Q43, G41, B43
[   632.162] (II) intel: Driver for Intel(R) HD Graphics: 2000-6000
[   632.162] (II) intel: Driver for Intel(R) Iris(TM) Graphics: 5100, 6100
[   632.162] (II) intel: Driver for Intel(R) Iris(TM) Pro Graphics: 5200, 6200, P6300
[   632.162] (++) using VT number 2

[   632.177] (II) intel(0): Using Kernel Mode Setting driver: i915, version 1.6.0 20140725
[   632.184] (--) intel(0): Integrated Graphics Chipset: Intel(R) HD Graphics 3000
[   632.184] (--) intel(0): CPU: x86-64, sse2, sse3, ssse3, sse4.1, sse4.2, avx
[   632.184] (II) intel(0): Creating default Display subsection in Screen section
    "Default Screen Section" for depth/fbbpp 24/32
[   632.184] (==) intel(0): Depth 24, (--) framebuffer bpp 32
[   632.184] (==) intel(0): RGB weight 888
[   632.184] (==) intel(0): Default visual is TrueColor
[   632.184] (**) intel(0): Option "AccelMethod" "sna"
[   632.184] (**) intel(0): Option "Backlight" "intel_backlight"
[   632.184] (II) intel(0): Output LVDS1 has no monitor section
[   632.184] (**) intel(0): Found backlight control interface intel_backlight (type 'raw') for output LVDS1
[   632.184] (II) intel(0): Enabled output LVDS1
[   632.185] (II) intel(0): Output VGA1 has no monitor section
[   632.185] (II) intel(0): Enabled output VGA1
[   632.185] (II) intel(0): Output HDMI1 has no monitor section
[   632.185] (II) intel(0): Enabled output HDMI1
[   632.185] (II) intel(0): Output DP1 has no monitor section
[   632.185] (II) intel(0): Enabled output DP1
[   632.185] (--) intel(0): Using a maximum size of 256x256 for hardware cursors
[   632.185] (II) intel(0): Output VIRTUAL1 has no monitor section
[   632.185] (II) intel(0): Enabled output VIRTUAL1
[   632.185] (--) intel(0): Output LVDS1 using initial mode 1366x768 on pipe 0
[   632.185] (--) intel(0): Output HDMI1 using initial mode 1920x1080 on pipe 1
[   632.185] (==) intel(0): TearFree disabled
[   632.185] (==) intel(0): DPI set to (96, 96)
[   632.185] (II) Loading sub module "dri2"
[   632.185] (II) LoadModule: "dri2"
[   632.185] (II) Module "dri2" already built-in
[   632.185] (II) Loading sub module "present"
[   632.185] (II) LoadModule: "present"
[   632.185] (II) Module "present" already built-in
[   632.185] (==) Depth 24 pixmap format is 32 bpp
[   632.201] (II) intel(0): SNA initialized with Sandybridge (gen6, gt2) backend
[   632.201] (==) intel(0): Backing store enabled
[   632.201] (==) intel(0): Silken mouse enabled
[   632.202] (II) intel(0): HW Cursor enabled
[   632.202] (II) intel(0): RandR 1.2 enabled, ignore the following RandR disabled message.
[   632.204] (==) intel(0): DPMS enabled
[   632.204] (==) intel(0): display hotplug detection enabled
[   632.204] (II) intel(0): [DRI2] Setup complete
[   632.204] (II) intel(0): [DRI2]   DRI driver: i965
[   632.204] (II) intel(0): [DRI2]   VDPAU driver: i965
[   632.204] (II) intel(0): direct rendering: DRI2 enabled
[   632.204] (II) intel(0): hardware support for Present enabled
[   632.204] (--) RandR disabled
[   632.390] (II) AIGLX: enabled GLX_MESA_copy_sub_buffer
[   632.390] (II) AIGLX: enabled GLX_ARB_create_context
[   632.390] (II) AIGLX: enabled GLX_ARB_create_context_profile
[   632.390] (II) AIGLX: enabled GLX_EXT_create_context_es2_profile
[   632.390] (II) AIGLX: enabled GLX_INTEL_swap_event
[   632.390] (II) AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control
[   632.390] (II) AIGLX: enabled GLX_EXT_framebuffer_sRGB
[   632.390] (II) AIGLX: enabled GLX_ARB_fbconfig_float
[   632.390] (II) AIGLX: GLX_EXT_texture_from_pixmap backed by buffer objects
[   632.390] (II) AIGLX: enabled GLX_ARB_create_context_robustness
[   632.391] (II) AIGLX: Loaded and initialized i965
[   632.391] (II) GLX: Initialized DRI2 GL provider for screen 0
[   632.405] (II) intel(0): switch to mode [email protected] on LVDS1 using pipe 0, position (0, 0), rotation normal, reflection none
[   632.407] (EE) intel(0): failed to set mode: Permission denied [13]
[   632.408] (II) intel(0): switch to mode [email protected] on HDMI1 using pipe 1, position (0, 0), rotation normal, reflection none
[   632.413] (EE) intel(0): failed to set mode: Permission denied [13]
[   632.413] (WW) intel(0): failed to restore desired modes on VT switch
[   632.413] (EE) intel(0): sna_mode_check: invalid state found on pipe 0, disabling CRTC:7
[   632.413] (EE) intel(0): sna_mode_check: invalid state found on pipe 1, disabling CRTC:11
[   632.769] (II) config/udev: Adding input device Power Button (/dev/input/event4)
[   632.769] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[   632.769] (II) LoadModule: "evdev"
[   632.813] (II) Loading /usr/lib/xorg/modules/input/evdev_drv.so
[   632.876] (II) Module evdev: vendor="X.Org Foundation"
[   632.876]    compiled for 1.16.2, module version = 2.9.1
[   632.876]    Module class: X.Org XInput Driver
[   632.876]    ABI class: X.Org XInput driver, version 21.0
[   632.878] (II) systemd-logind: got fd for /dev/input/event4 13:68 fd 18 paused 1
[   632.878] (II) systemd-logind: releasing fd for 13:68
[   632.904] (II) config/udev: Adding input device Video Bus (/dev/input/event16)
[   632.904] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
[   632.905] (II) systemd-logind: got fd for /dev/input/event16 13:80 fd 18 paused 1
[   632.905] (II) systemd-logind: releasing fd for 13:80
[   632.930] (II) config/udev: Adding input device Lid Switch (/dev/input/event1)
[   632.931] (II) No input driver specified, ignoring this device.
[   632.931] (II) This device may have been added with another device file.
[   632.931] (II) config/udev: Adding input device Video Bus (/dev/input/event11)
[   632.931] (**) Video Bus: Applying InputClass "evdev keyboard catchall"
[   632.933] (II) systemd-logind: got fd for /dev/input/event11 13:75 fd 18 paused 1
[   632.933] (II) systemd-logind: releasing fd for 13:75
[   632.955] (II) config/udev: Adding input device Power Button (/dev/input/event3)
[   632.955] (**) Power Button: Applying InputClass "evdev keyboard catchall"
[   632.956] (II) systemd-logind: got fd for /dev/input/event3 13:67 fd 18 paused 1
[   632.956] (II) systemd-logind: releasing fd for 13:67
[   632.984] (II) config/udev: Adding input device HDA Digital PCBeep (/dev/input/event6)
[   632.984] (II) No input driver specified, ignoring this device.
[   632.984] (II) This device may have been added with another device file.
[   632.985] (II) config/udev: Adding input device HDA Intel PCH Front Headphone (/dev/input/event8)
[   632.985] (II) No input driver specified, ignoring this device.
[   632.985] (II) This device may have been added with another device file.
[   632.985] (II) config/udev: Adding input device HDA Intel PCH HDMI/DP,pcm=3 (/dev/input/event9)
[   632.985] (II) No input driver specified, ignoring this device.
[   632.985] (II) This device may have been added with another device file.
[   632.986] (II) config/udev: Adding input device HDA Intel PCH Mic (/dev/input/event7)
[   632.986] (II) No input driver specified, ignoring this device.
[   632.986] (II) This device may have been added with another device file.
[   632.986] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event13)
[   632.986] (**) Logitech USB Receiver: Applying InputClass "evdev pointer catchall"
[   632.988] (II) systemd-logind: got fd for /dev/input/event13 13:77 fd 18 paused 1
[   632.988] (II) systemd-logind: releasing fd for 13:77
[   633.048] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/mouse1)
[   633.048] (II) No input driver specified, ignoring this device.
[   633.048] (II) This device may have been added with another device file.
[   633.049] (II) config/udev: Adding input device Logitech USB Receiver (/dev/input/event14)
[   633.049] (**) Logitech USB Receiver: Applying InputClass "evdev keyboard catchall"
[   633.050] (II) systemd-logind: got fd for /dev/input/event14 13:78 fd 18 paused 1
[   633.050] (II) systemd-logind: releasing fd for 13:78
[   633.104] (II) config/udev: Adding input device Microsft Microsoft Wireless Desktop Receiver 3.1 (/dev/input/event12)
[   633.104] (**) Microsft Microsoft Wireless Desktop Receiver 3.1: Applying InputClass "evdev keyboard catchall"
[   633.105] (II) systemd-logind: got fd for /dev/input/event12 13:76 fd 18 paused 1
[   633.105] (II) systemd-logind: releasing fd for 13:76
[   633.160] (II) config/udev: Adding input device Microsft Microsoft Wireless Desktop Receiver 3.1 (/dev/input/event15)
[   633.161] (**) Microsft Microsoft Wireless Desktop Receiver 3.1: Applying InputClass "evdev pointer catchall"
[   633.161] (**) Microsft Microsoft Wireless Desktop Receiver 3.1: Applying InputClass "evdev keyboard catchall"
[   633.162] (II) systemd-logind: got fd for /dev/input/event15 13:79 fd 18 paused 1
[   633.162] (II) systemd-logind: releasing fd for 13:79
[   633.224] (II) config/udev: Adding input device Microsft Microsoft Wireless Desktop Receiver 3.1 (/dev/input/mouse2)
[   633.224] (II) No input driver specified, ignoring this device.
[   633.224] (II) This device may have been added with another device file.
[   633.224] (II) config/udev: Adding input device AT Translated Set 2 keyboard (/dev/input/event0)
[   633.224] (**) AT Translated Set 2 keyboard: Applying InputClass "evdev keyboard catchall"
[   633.226] (II) systemd-logind: got fd for /dev/input/event0 13:64 fd 18 paused 1
[   633.226] (II) systemd-logind: releasing fd for 13:64
[   633.290] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/event10)
[   633.290] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "evdev touchpad catchall"
[   633.290] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "touchpad catchall"
[   633.290] (**) SynPS/2 Synaptics TouchPad: Applying InputClass "Default clickpad buttons"
[   633.290] (II) LoadModule: "synaptics"
[   633.291] (II) Loading /usr/lib/xorg/modules/input/synaptics_drv.so
[   633.346] (II) Module synaptics: vendor="X.Org Foundation"
[   633.346]    compiled for 1.16.0, module version = 1.8.1
[   633.346]    Module class: X.Org XInput Driver
[   633.346]    ABI class: X.Org XInput driver, version 21.0
[   633.348] (II) systemd-logind: got fd for /dev/input/event10 13:74 fd 18 paused 1
[   633.348] (II) systemd-logind: releasing fd for 13:74
[   633.397] (II) config/udev: Adding input device SynPS/2 Synaptics TouchPad (/dev/input/mouse0)
[   633.397] (**) SynPS/2 Synaptics TouchPad: Ignoring device from InputClass "touchpad ignore duplicates"
[   633.397] (II) config/udev: Adding input device ST LIS3LV02DL Accelerometer (/dev/input/event2)
[   633.397] (II) No input driver specified, ignoring this device.
[   633.397] (II) This device may have been added with another device file.
[   633.398] (II) config/udev: Adding input device ST LIS3LV02DL Accelerometer (/dev/input/js0)
[   633.398] (II) No input driver specified, ignoring this device.
[   633.398] (II) This device may have been added with another device file.
[   633.399] (II) config/udev: Adding input device HP WMI hotkeys (/dev/input/event5)
[   633.399] (**) HP WMI hotkeys: Applying InputClass "evdev keyboard catchall"
[   633.400] (II) systemd-logind: got fd for /dev/input/event5 13:69 fd 18 paused 1
[   633.400] (II) systemd-logind: releasing fd for 13:69

我正在使用带有 X 服务器版本 1.16.3 的 Arch Linux。 IRC 上的 #xorg 上的一个人确认,在他们的系统上,运行我指定的命令仍然允许他们访问其他虚拟终端,尽管他们使用的是 xorg 版本 1.15 而不是在 Arch Linux 上。

其他人可以确认他们的系统的行为是否如我所描述的那样(如果它的行为像我的那样,则需要重新启动系统)。如何手动启动 X 服务器并仍然可以访问其他虚拟终端?

答案1

我在这里找到了答案:https://www.archlinux.org/news/xorg-server-116-is-now-available/

X 现在在 systemd-logind 的帮助下是无根的,这也意味着它必须从用于登录的同一虚拟终端启动,重定向 stderr 也会破坏无根登录。可以通过 Xorg.wrap 配置文件 (man xorg.wrap) 恢复旧的 root 执行行为。请注意,通过登录管理器(gdm、kdm...)启动 X 尚不提供无根访问。

我试图在与我所在的不同的终端上启动 X。

相关内容