Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Feb 2021 16:39:44 +0000
From:      bugzilla-noreply@freebsd.org
To:        x11@FreeBSD.org
Subject:   [Bug 253278] x11-servers/xorg-server: Lock file: Various fixes
Message-ID:  <bug-253278-7141-gyWaiL9A49@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-253278-7141@https.bugs.freebsd.org/bugzilla/>
References:  <bug-253278-7141@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253278

Olivier Certner <olivier.freebsd@free.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|Affects Only Me             |Affects Some People

--- Comment #2 from Olivier Certner <olivier.freebsd@free.fr> ---
Hi, sorry for not having stated the high-level use case here:
- Launch X with "startx", specifying '/usr/local/bin/Xorg' as the server.
E.g.: "startx -- /usr/local/bin/Xorg :1"
You'll get an immediate crash saying "Can't read lock file /tmp/.X1-lock".
Although no lock file exists at all under '/tmp'.

The error comes from the fact that some lock file is prepared under another
name (e.g., for display :1, under name '/tmp/.tX1-lock'), and this file is =
then
hardlink to the final lock name using link(2), which improperly fails.=20


The point of fixes 2 and 3 is to respectively better report on this problem=
 and
solve it. 3 is a simplification of the existing code (no functional change
intended), which has the effect of working around a FreeBSD bug in link(2) =
that
I'm going to submit as a separate bug with patch. Fix 1 is unrelated, done
while I was looking at this code, and its usefulness is debatable, especial=
ly
once bug #253277 is fixed.

Even with this patch, pursuing with:
"startx -- /usr/local/bin/Xorg :1"
still doesn't work, because Xorg must be run as root. Substitution with:
"startx -- /usr/local/bin/X :1"
or
"startx -- /usr/local/bin/Xorg.wrap :1"
makes it work, but then the fixes are not needed, since link(2) works.

Given all that, here is a path I find reasonable:
1. Focus should be #253277, this one is secondary.
2. I'll submit these fixes upstream.

Maybe should we keep this PR open and I'll link the upstream bug here. Or I=
/you
can close it. Don't know what's the policy in such cases.

Thanks.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-253278-7141-gyWaiL9A49>