Bug 86975 - [xorg.wrap] xorg.wrap 1.16.2 incorrectly thinks i boot with systemd
Summary: [xorg.wrap] xorg.wrap 1.16.2 incorrectly thinks i boot with systemd
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
Depends on:
Reported: 2014-12-03 15:26 UTC by LoneVVolf
Modified: 2018-06-23 10:44 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:

session log (1.85 KB, text/plain)
2014-12-12 10:48 UTC, LoneVVolf
no flags Details
~/.local/share/xorg/Xorg.0.log (19.48 KB, text/plain)
2014-12-12 10:50 UTC, LoneVVolf
no flags Details
.xinitrc (617 bytes, text/plain)
2014-12-12 10:52 UTC, LoneVVolf
no flags Details

Description LoneVVolf 2014-12-03 15:26:36 UTC
I am running archlinux x86_64 with systemd installed (for udev functionality) but boot with openrc 0.13.5 .

I am using KMS / opensource r600 driver.

Upon running startx , Xorg.wrap tries to start rootless .

As i don't boot with systemd , logind fails and X is not started.

I have solved this by creating /etc/X11/Xwrapper.config with this context :

# Xorg.wrap configuation file
needs_root_rights = yes

I do feel however that the detection method used by Xorg.wrap to determine whether rootless X is possible is flawed and needs to be corrected.

Comment 1 LoneVVolf 2014-12-12 10:48:47 UTC
Created attachment 110772 [details]
session log
Comment 2 LoneVVolf 2014-12-12 10:50:18 UTC
Created attachment 110773 [details]
Comment 3 LoneVVolf 2014-12-12 10:52:34 UTC
Created attachment 110774 [details]
Comment 4 LoneVVolf 2014-12-12 10:56:57 UTC
I've checked with latest archlinux official package xorg-server , same problem.

I moved Xwrapper.config temporarily to a backup location,
then logged in as normal user on tty2 and ran startx manually.

Logs & my .xinitrc have been attached.
Comment 5 Hans de Goede 2014-12-12 12:01:42 UTC
Hi LoneVVolf,

The wrapper is actually not detecting systemd presence at all, it only detects if a kms driver is used, and if one is it assumes that root rights are not necessary (because they really are not when kms is used).

The wrapper is not installed by default, it only gets installed, if --enable-suid-wrapper is passed to ./configure. If your distro is enabling the wrapper, and not using systemd-logind it should install an /etc/X11/Xwrapper.config file as you've done since without systemd-logind running as non root does not work.

If your distro allows you to disable systemd-logind, then either the instructions for doing that should include instructions on setting up /etc/X11/Xwrapper.config, or, preferably, this should happen automatically when systemd-logind gets disabled.

TL;DR: You're distro has explicitly chosen to enable the wrapper, if your distro wants to / allows to use the wrapper without systemd-logind, then your distro must provide an /etc/X11/Xwrapper.config file specifying that X should always run as root.

Please take this up with your distro.


Comment 6 LoneVVolf 2014-12-12 16:02:37 UTC

thank you for responding.

My distro does indeed build xorg-server with
--enable-suid-wrapper (and also  --enable-systemd-logind ).

As archlinux default init system is systemd , on most archlinux systems logind is running.
The change is communicated to users upon installing xorg-server 1.16+ and Xwrapper.config is documented in the archlinux wiki.

The reason why i opened this bug is that a build-time flag (--enable-suid-wrapper) results in an implicit hard dependency on systemd-logind AT RUNTIME.

If that dependency is not fulfilled, Xorg crashes.
Imo that's a flawed design.

I can think of several options to solve this in a clean way :

Add a runtime check for a running systemd-logind, give an error message when it's not fulfilled and abort.

add the check, give a warning message and fallback to pre-1.16 behaviour

switch to a mechanism that doesn't require a method only available when one specific init system is active.

These options could indeed be implemented on distro level, but that would mean every distro that supports systemd as init AND other init systems would need to write their own wrapper to start X .

Since xorg-server introduced the hard implicit runtime dependency i feel  xorg-server needs to solve it.
While my personal preference is option B, all 3 options achieve that.
Comment 7 LoneVVolf 2018-06-23 10:44:09 UTC
It's debatable whether the fault is with Xorg of systemd desigmn/implementation, but there's a good workaround through xorg.wrap.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.