Bug 93072 - systemd socket activation is broken for xserver 1.18
Summary: systemd socket activation is broken for xserver 1.18
Alias: None
Product: xorg
Classification: Unclassified
Component: Server/General (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: Xorg Project Team
QA Contact: Xorg Project Team
Depends on:
Reported: 2015-11-22 22:10 UTC by Abdó Roig-Maranges
Modified: 2018-12-13 22:34 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:

strace for xset q (8.11 KB, text/plain)
2015-11-22 22:10 UTC, Abdó Roig-Maranges
no flags Details

Description Abdó Roig-Maranges 2015-11-22 22:10:31 UTC
Created attachment 120038 [details]
strace for xset q

I run xorg as a socket activated systemd service. Since I upgraded to version 1.18 of the X server, socket activation does not work. It all worked as expected in 1.17.

The client that triggers the socket-activation, gets stuck. Here is a way to reproduce the problem from the command line on a linux system running systemd:

    $ /usr/lib/systemd/systemd-activate -l /tmp/.X11-unix/X0 /usr/bin/Xorg :0 -nolisten tcp -noreset -verbose 3 vt2 &

    $ DISPLAY=:0 xset q

The first line emulates socket activation, by waiting on the socket and launching the X server on first connection.

When the second line is executed, it triggers the xorg activation correctly, the X server starts without problems, but xset gets stuck (never returns). 

Other invocations of xset q after the server is already started work as expected.

I attach an strace for the xset command in the getting-stuck scenario.
Comment 1 mitunter 2016-01-28 21:19:33 UTC
I'm seeing this as well.
Comment 2 Laércio de Sousa 2016-03-07 14:27:30 UTC
In which distro release did you observe this problem?

I've also observed it in Ubuntu 15.10 (which ships Xorg 1.17.2 and systemd 225), but it does work in openSUSE Leap 42.1 (which also ships Xorg 1.17.2, but stays on systemd 210). I'll repeat the tests in Ubuntu 16.04 beta 1 and openSUSE Tumbleweed.
Comment 3 Laércio de Sousa 2016-03-08 18:49:01 UTC
I've tested Xorg socket activation in Ubuntu 16.04 beta1 (xorg-server 1.17.3 + systemd 229) and openSUSE Tumbleweed (xorg-server 1.18.1 + systemd 228). One more time, Ubuntu is affected by this bug, but openSUSE is not.
Comment 4 Abdó Roig-Maranges 2016-03-11 19:49:59 UTC
I'm running arch linux.

At the time I reported this, I was running systemd 227 or 228, I can't tell exactly, because arch pushed 228 at around that time too.

I'm pretty sure though, that the issue manifested itself after upgrading xorg from 1.17 to 1.18. I noticed the problem immediately, because at that time my window manager was running on a socket activated xorg. It broke my system.

I've just tested it again with systemd 229 and xorg 1.18.1. The issue persists, however now the whole vt system gets frozen. I can't even change vt with Ctrl+Alt+Fn after the two commands I suggested.

It is possible that systemd-logind is involved, or maybe I'm now seeing two different issues...

I'll try to get more useful data and report back.
Comment 5 mitunter 2016-03-11 19:58:43 UTC
I'm also running arch (systemd 229, xorg 1.18). A quick fix is to make sure, that the xorg server is started before any units that require it get started. See https://www.reddit.com/r/archlinux/comments/3twekg/xorg_118_messes_with_socket_activation_in_systemd/
Comment 6 GitLab Migration User 2018-12-13 22:34:40 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xorg/xserver/issues/491.

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.