Module init ordering (Re: [PATCH weston] man: weston --xserver has been replaced)

Pekka Paalanen ppaalanen at
Thu Sep 13 04:06:45 PDT 2012

On Thu, 13 Sep 2012 13:46:27 +0300
Pekka Paalanen <ppaalanen at> wrote:

> The generic module loading must be used now to load
> Option --xserver was removed by
> a6813d28876423b388cce3ff6d7edab7b9de0f20.

Hi Kristian,

related to the above-mentioned change, the module loading order is no
longer constant. In the usual case for XWayland:

[13:50:00.585] Loading module '/home/pq/local/lib/weston/'
[13:50:00.586] launching '/home/pq/local/libexec/weston-desktop-shell'
[13:50:00.587] Loading module '/home/pq/local/lib/weston/'
[13:50:00.588] xserver listening on display :1
[13:50:00.588] libwayland: using socket /home/pq/local/tmp/wayland-0

That shows that weston-desktop-shell is forked before xwayland is
loaded, and hence no Wayland client started through the shell will have
DISPLAY set. This is obvious if you launch weston-terminal from the
panel launcher button, and try to start xterm from it.

There might also be another issue, a real race that has existed for a
long time. If the just-forked weston-desktop-shell happens to run
before weston gets to "libwayland: using socket ..." part, will it fail
to connect to the server and die?

Should we perhaps have a two-stage module init?
1. module init only
2. server is up and environment set, can launch clients now


More information about the wayland-devel mailing list