[PATCH 0/3] libxtrans + xserver: Add support for systemd socket activation (v5)

Łukasz Stelmach l.stelmach at samsung.com
Wed Dec 4 05:46:29 PST 2013


It was <2013-12-04 śro 10:56>, when Hans de Goede wrote:
> Hi,
>
> On 12/03/2013 08:20 PM, Kristian Høgsberg wrote:
>> On Tue, Dec 3, 2013 at 1:48 AM, Hans de Goede <hdegoede at redhat.com> wrote:
>>> Hi,
>>>
>>>
>>> On 12/02/2013 09:54 PM, Kristian Høgsberg wrote:
>>>>
>>>> On Mon, Dec 2, 2013 at 11:44 AM, Hans de Goede <hdegoede at redhat.com>
>>>> wrote:
>>>>>
>>>>> Hi All,
>>>>
>>>>
>>>> Hi,
>>>>
>>>> I didn't follow all this in detail, but I'm not sure that we need
>>>> Xtrans patches at all.  The server already has ListenOnOpenFD() in
>>>> os/connection.c.  It was added for launchd under OSX, but we use it
>>>> for xwayland socket activation too.
>>>
>>>
>>> Looking at how this is used, it is used for fds which are received through
>>> messages send over another fd while the Xserver is running.
>>>
>>> Where as the systemd sockets are passed in as already open fds on startup
>>> (just like stdout & friends are already open on startup).
>>
>> I know, but I'm not sure why that matters?  The server receives an fd
>> that's one end of a socket, whether it comes from the environment or
>> through another socket doesn't seem relevant.
>>
>>> Note that libxtrans has code for OSX for getting sockets passed at startup
>>> to, see this bit in XTrans.c:
>>
>> But why? What's the point?  I'm trying to help you by making your
>> patch set smaller here...
>
> I understand and your input is appreciated.
>
> Note that I did not write the original patchset, I merely dusted it off
> and cleaned it up a bit.
>
> AFAIK the systemd socket activation needs to be done in libxtrans because it
> is not about adding new sockets, it is about using systemd provided sockets
> for (some of) the initial sockets the xserver creates at startup. Since
> libxtrans creates the initial set of sockets the server listens on on startup,
> it needs to be modified to not create them and instead use the systemd
> provided ones.
>
> But maybe Łukasz, the author of the original patchset has a better answer,
> Łukasz ?

I've deciced to put my code in libxtrans because:

a) this is the place where the sockets are created, and I thought, and
still do that the easiest way to add support for systemd socket
activation is to crate a some code as close to the place where the
socket(2) and bind(2) are called as possible,

b) I've found some OSX launchd code there doing exactly the same,

c) there was no xwayland branch I could learn from at the time I started
developing my patches.

I am no expert to judge if this is the *best* way.

As far as I can tell ListenOnOpenFD() is a Darwin/Quartz specific. It
depends on XQUARTZ beeing defined and has a lauchd path hardcoded. At
least in the master branch. I can see you've removed the ifdef in the
xwayland branch. I can also see that you've made[1] quite a lot of
different changes I don't quite understand and I wouldn't know how to
port them to the master branch.

My goal is to be able to start X with systemd's socket activation and my
patches do the job (quite well IMHO).

[1] git diff origin/mastter origin/xwayland

Kind regards,
-- 
Łukasz Stelmach
Samsung R&D Institute Poland
Samsung Electronics
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20131204/b125a914/attachment.pgp>


More information about the xorg-devel mailing list