GNU bug report logs - #35068
GDM crashes when it cannot find any .desktop files

Previous Next

Package: guix;

Reported by: Ludovic Courtès <ludo <at> gnu.org>

Date: Mon, 1 Apr 2019 08:06:01 UTC

Severity: normal

Done: Timothy Sample <samplet <at> ngyro.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 35068 in the body.
You can then email your comments to 35068 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Mon, 01 Apr 2019 08:06:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Courtès <ludo <at> gnu.org>:
New bug report received and forwarded. Copy sent to bug-guix <at> gnu.org. (Mon, 01 Apr 2019 08:06:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Bug Guix <bug-guix <at> gnu.org>
Subject: GDM crashes when it cannot find any .desktop files
Date: Mon, 01 Apr 2019 10:05:16 +0200
Hello,

I used to have a config (when using SLiM) where my system profile did
not contain any window manager, so no .desktop files.  Instead, the WM
would be installed in my profile and ~/.xsession would start it and a
couple of other things.

Unfortunately GDM crashes in that context.  More precisely, after
choosing the user name on the log-in screen, it enters an infinite loop
with an assertion failure:

  gdm_session_set_environment_variable: assertion 'value != NULL' failed

At that point you pretty much have to reboot since it becomes very hard
to type at the console.  (You can try it in a VM.)

The workaround is to add at least one window manager to the system’s
‘packages’ field.

It would be nice to fix it now that GDM is our default log-in manager.

Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Sat, 20 Apr 2019 15:07:01 GMT) Full text and rfc822 format available.

Message #8 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 35068 <at> debbugs.gnu.org
Cc: Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Sat, 20 Apr 2019 17:06:49 +0200
[Message part 1 (text/plain, inline)]
Hi,

I just got hit by a similar problem.  I've got .xinitrc in my home directory
and no .xsession file.  The former just invokes startfluxbox.

Now after guix system reconfigure, gdm got selected as login manager.
After I log in at the gdm prompt,  it enters an endless loop, switching
terminals with almost no delay--which makes further debugging difficult.

I *think* I saw an authentication failure after I typed in my user name,
but I can't be sure.  It doesn't ever ask for my password.

I'm writing this from a recovery shell which I entered like the following:

* Reboot
* Let gdm start
* Do NOT log in (if I did, it would endless-loop the machine)
* Press Ctrl-Alt-F2
* on the text console, invoke "ps -ef |grep xorg" and type the command line
so shown again, but insert ":1" as the first argument.
* Press Ctrl-Alt-F3
* Invoke:
  DISPLAY=:1 startfluxbox
* Press Alt-F8

I have the following suggestions for improvements:

(1) Please back off after trying to login so one can actually debug things.
If the login doesn't work on the first try it won't work on the next 245 tries
in the next second either.
(2) Please have a failure fallback that at least returns you to gdm instead of
looping forever.
(3) If there is an error message plase show it in a dialog box--
there's xdialog and zenity that allows you to show a dialog box easily.
(4) Please honor .xsession and .xinitrc if it's there
(5) Please make gdm state the key to use in order to select a session type.
I've still got no idea how to select a different session type in gdm.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Sat, 20 Apr 2019 20:23:01 GMT) Full text and rfc822 format available.

Message #11 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 35068 <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Sat, 20 Apr 2019 22:22:37 +0200
Hi,

Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> I have the following suggestions for improvements:
>
> (1) Please back off after trying to login so one can actually debug things.
> If the login doesn't work on the first try it won't work on the next 245 tries
> in the next second either.
> (2) Please have a failure fallback that at least returns you to gdm instead of
> looping forever.
> (3) If there is an error message plase show it in a dialog box--
> there's xdialog and zenity that allows you to show a dialog box easily.
> (4) Please honor .xsession and .xinitrc if it's there
> (5) Please make gdm state the key to use in order to select a session type.
> I've still got no idea how to select a different session type in gdm.

We should identity how that GDM assertion failure is reached and patch
GDM to simply print an error or bail out.  Anything would be better than
the endless loop.

(Note that the zero-.desktop-files situation cannot happen when
installing from our installation image, so I would not consider it a 1.0
blocker; it’s definitely something we should fix, though.)

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Sun, 21 Apr 2019 09:38:02 GMT) Full text and rfc822 format available.

Message #14 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 35068 <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Sun, 21 Apr 2019 11:37:49 +0200
[Message part 1 (text/plain, inline)]
Further investigation:

diff -ru orig/gdm-3.26.2.1/daemon/gdm-session.c gdm-3.26.2.1/daemon/gdm-session.c
--- orig/gdm-3.26.2.1/daemon/gdm-session.c      1970-01-01 01:00:00.000000000 +0100
+++ gdm-3.26.2.1/daemon/gdm-session.c   2019-04-21 10:58:31.211164558 +0200
@@ -2483,6 +2483,10 @@
                                       const char *value)
 {
         g_return_if_fail (key != NULL);
+        if (value == NULL) {
+                g_warning ("XXX gdm: value == NULL for key == %s", key);
+                value = "";
+        }
         g_return_if_fail (value != NULL);
 
         g_hash_table_replace (self->priv->environment,

Yields:

Apr 21 11:23:57 localhost gdm: XXX gdm: value == NULL for key == PATH 
Apr 21 11:23:57 localhost gdm: Child process -1384 was already dead. 
Apr 21 11:23:57 localhost gdm: Child process 1381 was already dead. 
Apr 21 11:23:57 localhost gdm: Unable to kill session worker process 

and endless loop.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Sun, 21 Apr 2019 09:44:01 GMT) Full text and rfc822 format available.

Message #17 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: 35068 <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Sun, 21 Apr 2019 11:43:16 +0200
[Message part 1 (text/plain, inline)]
Apr 21 11:38:51 localhost gdm: GdmSessionWorkerJob: Running session_worker_job process: gdm-session-worker [pam/gdm-launch-environment] /gnu/store/qz8413ijzxnh6kfkxr8syxjwvhsc6s3a-gdm-3.26.2.1/libexec/gdm-session-worker 
Apr 21 11:38:51 localhost gdm: GdmSessionWorkerJob: : SessionWorkerJob on pid 1463 
Apr 21 11:38:51 localhost gdm: Child process -1457 was already dead. 
Apr 21 11:38:51 localhost gdm: GdmSessionWorkerJob: Stopping job pid:1454 
Apr 21 11:38:51 localhost gdm: Child process 1454 was already dead. 
Apr 21 11:38:51 localhost gdm: Unable to kill session worker process 
[...]
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Sun, 21 Apr 2019 20:13:01 GMT) Full text and rfc822 format available.

Message #20 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 35068 <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Sun, 21 Apr 2019 22:12:42 +0200
[Message part 1 (text/plain, inline)]
Danny Milosavljevic <dannym <at> scratchpost.org> skribis:

> Apr 21 11:23:57 localhost gdm: XXX gdm: value == NULL for key == PATH 
> Apr 21 11:23:57 localhost gdm: Child process -1384 was already dead. 
> Apr 21 11:23:57 localhost gdm: Child process 1381 was already dead. 
> Apr 21 11:23:57 localhost gdm: Unable to kill session worker process 

Good catch!

Looks like setting PATH in GDM’s environment isn’t enough, though…

Ludo’.

[Message part 2 (text/x-patch, inline)]
diff --git a/gnu/services/xorg.scm b/gnu/services/xorg.scm
index d4e73c13b4..26cfad6044 100644
--- a/gnu/services/xorg.scm
+++ b/gnu/services/xorg.scm
@@ -859,7 +859,11 @@ the GNOME desktop environment.")
                                   ;; can depend on GNOME Shell directly.
                                   (cons #$gnome-shell
                                         '#$(gdm-configuration-gnome-shell-assets
-                                            config)))))))))
+                                            config)))))
+
+                           ;; GDM wrecks havoc when PATH is unset:
+                           ;; <https://bugs.gnu.org/35068>.
+                           "PATH=/run/current-system/profile/bin"))))
          (stop #~(make-kill-destructor))
          (respawn? #t))))
 
diff --git a/gnu/system/examples/desktop.tmpl b/gnu/system/examples/desktop.tmpl
index 3931bad60d..e3afe0b8e2 100644
--- a/gnu/system/examples/desktop.tmpl
+++ b/gnu/system/examples/desktop.tmpl
@@ -62,12 +62,7 @@
   ;; by clicking the gear.  Use the "desktop" services, which
   ;; include the X11 log-in service, networking with
   ;; NetworkManager, and more.
-  (services (append (list (service gnome-desktop-service-type)
-                          (service xfce-desktop-service-type)
-                          (set-xorg-configuration
-                           (xorg-configuration
-                            (keyboard-layout keyboard-layout))))
-                    %desktop-services))
+  (services %desktop-services)
 
   ;; Allow resolution of '.local' host names with mDNS.
   (name-service-switch %mdns-host-lookup-nss))

Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Thu, 25 Apr 2019 18:50:02 GMT) Full text and rfc822 format available.

Message #23 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Timothy Sample <samplet <at> ngyro.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>, 35068 <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Thu, 25 Apr 2019 14:49:42 -0400
Hi Ludo and Danny,

Date: Thu, 25 Apr 2019 11:36:36 -0400

Ludovic Courtès <ludo <at> gnu.org> writes:

> Danny Milosavljevic <dannym <at> scratchpost.org> skribis:
>
>> Apr 21 11:23:57 localhost gdm: XXX gdm: value == NULL for key == PATH 
>> Apr 21 11:23:57 localhost gdm: Child process -1384 was already dead. 
>> Apr 21 11:23:57 localhost gdm: Child process 1381 was already dead. 
>> Apr 21 11:23:57 localhost gdm: Unable to kill session worker process 
>
> Good catch!
>
> Looks like setting PATH in GDM’s environment isn’t enough, though…

The PATH variable for GDM gets set in the package definition, too.  GDM
does a lot of environment clobbering, so it probably gets lost along the
way (it wants to follow the PAM default environment files rather than
propagate things down).  That being said, I don’t think this is the
issue.

GDM is hard-coded to fail if there are no “.desktop” files.  This
happens in the “get_fallback_session_name” function.  As an experiment,
I tried patching this out, which allows me to type in a password, but
fails later in the same way.  I’m not sure why.

I suppose we should add a default “.desktop” file to keep GDM from
exploding.  I did look at Danny’s patch (#35377), and it would work, but
it seems a little arbitrary.  Nothing understands the “Exec=custom”
line, and our “xinitrc” runs “~/.xsession” regardless of what desktop
entry is selected in the DM.

There are two workarounds.  The first is to keep Danny’s patch as-is,
but add logic to “xinitrc” so that it only uses “~/.xsession” when
passed “custom” as an argument (it’s kinda magic, but it seems to be a
common convention).  I have a slight preference for this option, because
it makes the whole “~/.xsession” thing more explicit.  However, it would
break other DMs that don’t install a “custom.desktop”.  Maybe we could
integrate it into all DMs at the service level.

The quicker workaround is to keep the current logic, and install the
following with GDM:

    [Desktop Entry]
    Encoding=UTF-8
    Type=Application
    Name=Fail
    Comment=This session always fails.
    NoDisplay=true
    Exec=false

This way, GDM fails cleanly when there are no “.desktop” files.  It
doesn’t show up in the list, either (“NoDisplay=true”), so everything
just kinda works as expected without any visible changes.

Danny, maybe you could adjust your patch to follow the second option and
apply it for the sake of everyone else who’s system profile doesn’t have
any “.desktop” files.  It might save people headaches in the short-term
regardless of what we settle on as a final solution.

Thoughts?


-- Tim




Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Thu, 25 Apr 2019 19:16:02 GMT) Full text and rfc822 format available.

Message #26 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Timothy Sample <samplet <at> ngyro.com>
Cc: 35068 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Thu, 25 Apr 2019 21:15:40 +0200
[Message part 1 (text/plain, inline)]
Hi Timothy,

On Thu, 25 Apr 2019 14:49:42 -0400
Timothy Sample <samplet <at> ngyro.com> wrote:

> exploding.  I did look at Danny’s patch (#35377), and it would work, but
> it seems a little arbitrary.  Nothing understands the “Exec=custom”
> line, and our “xinitrc” runs “~/.xsession” regardless of what desktop
> entry is selected in the DM.

gdm does know it.  It bundles gdm Xsession startup scripts and then runs
".xsession" (see data/Xsession.in) if available, otherwise ~/.Xclients.

> There are two workarounds.  The first is to keep Danny’s patch as-is,
> but add logic to “xinitrc” so that it only uses “~/.xsession” when

.xinitrc is not picked up by gdm.  Do you mean by startx?

> break other DMs that don’t install a “custom.desktop”.  Maybe we could
> integrate it into all DMs at the service level.

Well, the best way would be for gdm to support .xsession files like anyone
else (without desktop file)--but I'm not holding my breath.
 
> This way, GDM fails cleanly when there are no “.desktop” files.  It
> doesn’t show up in the list, either (“NoDisplay=true”), so everything
> just kinda works as expected without any visible changes.

I want it to show up in the list.  Maybe we are trying to reach different
goals here.  I have a ~/.xsession script for close to a decade now and I
want gdm to use it.  It's not only to keep gdm from crashing, it's so I
can get into my normal customized desktop.

Doesn't Exec=false make the login fail?  Or do you mean gdm will pick up
.xsession anyway and run it--and after the session is terminated, the
login will fail?  Why would it then fail?  Why not make it succeed?

> Danny, maybe you could adjust your patch to follow the second option and
> apply it for the sake of everyone else who’s system profile doesn’t have
> any “.desktop” files.  It might save people headaches in the short-term
> regardless of what we settle on as a final solution.

Sounds good in principle, as long as it actually allows me to log in to
my desktop.

FWIW, "Exec=custom" is the way gdm itself does it.

Still, ~/.xinitrc is not picked up either way--which is too bad.
[Message part 2 (application/pgp-signature, inline)]

Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Fri, 26 Apr 2019 01:04:01 GMT) Full text and rfc822 format available.

Message #29 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Timothy Sample <samplet <at> ngyro.com>
To: Danny Milosavljevic <dannym <at> scratchpost.org>
Cc: 35068 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Thu, 25 Apr 2019 21:02:53 -0400
Hi Danny,

Oh my!  I explained things very poorly.  Sorry.  I’ll provide some more
context.

Danny Milosavljevic <dannym <at> scratchpost.org> writes:

> Hi Timothy,
>
> On Thu, 25 Apr 2019 14:49:42 -0400
> Timothy Sample <samplet <at> ngyro.com> wrote:
>
>> exploding.  I did look at Danny’s patch (#35377), and it would work, but
>> it seems a little arbitrary.  Nothing understands the “Exec=custom”
>> line, and our “xinitrc” runs “~/.xsession” regardless of what desktop
>> entry is selected in the DM.
>
> gdm does know it.  It bundles gdm Xsession startup scripts and then runs
> ".xsession" (see data/Xsession.in) if available, otherwise ~/.Xclients.

By default, GDM does not bundle an Xsession script.  You have to pass
“--enable-gdm-xsession” to the configure script for it to be installed.
I added this flag in 51bc8357e8457d5d7168d8837da6e14fa2d98485, but the
script doesn’t support “~/.xsession” scripts, so (after some discussion)
I removed it in 41fa9f1815685ede0d3fdc1c561d2a9cf0ffb158.  It seems that
most distros use their own scripts and in turn, the GDM folks don’t
really give much thought to “data/Xsession.in”.

Furthermore (I was surprised by this), even though the
“data/Xsession.in” script says that it will honour “custom” in a
comment, the code says otherwise.  There’s a commit where support for it
gets removed, but they must have forgotten about the comment.

>> There are two workarounds.  The first is to keep Danny’s patch as-is,
>> but add logic to “xinitrc” so that it only uses “~/.xsession” when
>
> .xinitrc is not picked up by gdm.  Do you mean by startx?

No.  We have our own script that we use to initialize X and it is bound
to “xinitrc” in “gnu/services/xorg.scm”.  You can override it from the
GDM configuration record.

>> break other DMs that don’t install a “custom.desktop”.  Maybe we could
>> integrate it into all DMs at the service level.
>
> Well, the best way would be for gdm to support .xsession files like anyone
> else (without desktop file)--but I'm not holding my breath.

We don’t need a “.desktop” file currently.  My personal opinion is that
having the existence of the “~/.xsession” script override your
explicitly stated session selection when logging in is a little
surprising.  But if that’s conventional, then I’m happy to follow
convention.

>> This way, GDM fails cleanly when there are no “.desktop” files.  It
>> doesn’t show up in the list, either (“NoDisplay=true”), so everything
>> just kinda works as expected without any visible changes.
>
> I want it to show up in the list.  Maybe we are trying to reach different
> goals here.  I have a ~/.xsession script for close to a decade now and I
> want gdm to use it.  It's not only to keep gdm from crashing, it's so I
> can get into my normal customized desktop.
>
> Doesn't Exec=false make the login fail?  Or do you mean gdm will pick up
> .xsession anyway and run it--and after the session is terminated, the
> login will fail?  Why would it then fail?  Why not make it succeed?

Currently, our “xinitrc” script will run your “~/.xsession” script if it
exists, regardless of what session you select when logging in.  However,
GDM will crash if you do not have any “.desktop” files.  You don’t
really need a “.desktop” file for anything, but GDM goes nuts if it
can’t find any.  So, we could fix GDM, but that looks pretty tricky.  In
lieu of that, we could provide a dummy “.desktop” that is invisible and
exists only to placate GDM when no other “.desktop” file exists.  With
the dummy file, if you have a “~/.xsession” script, you will be able to
log in even if you have no other “.desktop” files.  If you have no
“.desktop” files and no “~/.xsession” script, logging in will fail
(which seems reasonable, seeing how desperate the circumstances are).

>> Danny, maybe you could adjust your patch to follow the second option and
>> apply it for the sake of everyone else who’s system profile doesn’t have
>> any “.desktop” files.  It might save people headaches in the short-term
>> regardless of what we settle on as a final solution.
>
> Sounds good in principle, as long as it actually allows me to log in to
> my desktop.

According to all the tests I did this afternoon, it should!  :)

For people with other “.desktop” files, everything should be the same.
For people with no other “.desktop” files GDM will no longer go bananas,
but rather let you log in using “~/.xsession”.

> FWIW, "Exec=custom" is the way gdm itself does it.

It’s true that most distros honour “custom” in their scripts.  It
doesn’t happen at the GDM level, though (like I wrote above).

> Still, ~/.xinitrc is not picked up either way--which is too bad.

Isn’t that script specific to “startx”?  (That’s at least what a popular
question and answer site tells me.)


-- Tim




Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Fri, 26 Apr 2019 08:11:02 GMT) Full text and rfc822 format available.

Message #32 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Timothy Sample <samplet <at> ngyro.com>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>, 35377 <at> debbugs.gnu.org,
 35068 <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Fri, 26 Apr 2019 10:10:48 +0200
Hello,

Timothy Sample <samplet <at> ngyro.com> skribis:

> There are two workarounds.  The first is to keep Danny’s patch as-is,
> but add logic to “xinitrc” so that it only uses “~/.xsession” when
> passed “custom” as an argument (it’s kinda magic, but it seems to be a
> common convention).  I have a slight preference for this option, because
> it makes the whole “~/.xsession” thing more explicit.  However, it would
> break other DMs that don’t install a “custom.desktop”.  Maybe we could
> integrate it into all DMs at the service level.
>
> The quicker workaround is to keep the current logic, and install the
> following with GDM:
>
>     [Desktop Entry]
>     Encoding=UTF-8
>     Type=Application
>     Name=Fail
>     Comment=This session always fails.
>     NoDisplay=true
>     Exec=false
>
> This way, GDM fails cleanly when there are no “.desktop” files.  It
> doesn’t show up in the list, either (“NoDisplay=true”), so everything
> just kinda works as expected without any visible changes.

I have a slight preference for the hack you propose Timothy, at least in
the short term, because it seems less likely to break anything than
fiddling with “Exec=custom” and all that.

Anyway, it’d be great if one of you could push a fix by 1.0.  :-)

Thanks,
Ludo’.




Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Fri, 26 Apr 2019 09:37:01 GMT) Full text and rfc822 format available.

Message #35 received at 35068 <at> debbugs.gnu.org (full text, mbox):

From: Danny Milosavljevic <dannym <at> scratchpost.org>
To: Timothy Sample <samplet <at> ngyro.com>
Cc: 35068 <at> debbugs.gnu.org, Ludovic Courtès <ludo <at> gnu.org>
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Fri, 26 Apr 2019 11:36:03 +0200
[Message part 1 (text/plain, inline)]
Hi Timothy,

On Thu, 25 Apr 2019 21:02:53 -0400
Timothy Sample <samplet <at> ngyro.com> wrote:

> Furthermore (I was surprised by this), even though the
> “data/Xsession.in” script says that it will honour “custom” in a
> comment, the code says otherwise.  There’s a commit where support for it
> gets removed, but they must have forgotten about the comment.

> We don’t need a “.desktop” file currently.  My personal opinion is that
> having the existence of the “~/.xsession” script override your
> explicitly stated session selection when logging in is a little
> surprising.  But if that’s conventional, then I’m happy to follow
> convention.

I don't know what's conventional here.

But a CUSTOM session is just that:
A customer customized their session and presumably wants to enter that
customized session.  However, he should still be able to enter other
sessions by selecting a non-customized session in the DM.

If I wrote a DM, I'd scan for desktop files, add those to the session selection
menu, then scan for the file "~/.xsession" and, if that exists, add a
"custom" entry to the session selection menu.

The session that had been selected previously for that user should be the
default for that user the next time--unless he changes the selection again.

The first time a ~/.xsession shows up, the session manager should select it
(or ask).

In any case, let's just make gdm not crash and do a minimally invasive fix.
We are not upstream and they can clean up their own mess.

> >> This way, GDM fails cleanly when there are no “.desktop” files.  It
> >> doesn’t show up in the list, either (“NoDisplay=true”), so everything
> >> just kinda works as expected without any visible changes.  

Nice!

> Currently, our “xinitrc” script will run your “~/.xsession” script if it
> exists, regardless of what session you select when logging in.

Hmm, that's not what I thought it would do.  We could change it...

> However, GDM will crash if you do not have any “.desktop” files.

Yeah, there are a lot of places where it assumes that desktop files
have been read.  Even the "fallback" case requires desktop files.

>  With
> the dummy file, if you have a “~/.xsession” script, you will be able to
> log in even if you have no other “.desktop” files.  If you have no
> “.desktop” files and no “~/.xsession” script, logging in will fail
> (which seems reasonable, seeing how desperate the circumstances are).

That's fair.

> > Still, ~/.xinitrc is not picked up either way--which is too bad.  
> 
> Isn’t that script specific to “startx”?  (That’s at least what a popular
> question and answer site tells me.)

Yes, I had it from the time I still used startx.

So I guess it's okay if .xinitrc isn't used by gdm.

It would still be nice if .xsession was only used for the "custom session"
choice, which is what I wanted it to do.  I guess we could also adapt
our xinitrc script.
[Message part 2 (application/pgp-signature, inline)]

Reply sent to Timothy Sample <samplet <at> ngyro.com>:
You have taken responsibility. (Fri, 26 Apr 2019 18:33:02 GMT) Full text and rfc822 format available.

Notification sent to Ludovic Courtès <ludo <at> gnu.org>:
bug acknowledged by developer. (Fri, 26 Apr 2019 18:33:03 GMT) Full text and rfc822 format available.

Message #40 received at 35068-done <at> debbugs.gnu.org (full text, mbox):

From: Timothy Sample <samplet <at> ngyro.com>
To: Ludovic Courtès <ludo <at> gnu.org>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>, 35068-done <at> debbugs.gnu.org,
 35377-done <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Fri, 26 Apr 2019 14:32:40 -0400
Hi Ludo and Danny,

Ludovic Courtès <ludo <at> gnu.org> writes:

> Hello,
>
> Timothy Sample <samplet <at> ngyro.com> skribis:
>
>> There are two workarounds.  The first is to keep Danny’s patch as-is,
>> but add logic to “xinitrc” so that it only uses “~/.xsession” when
>> passed “custom” as an argument (it’s kinda magic, but it seems to be a
>> common convention).  I have a slight preference for this option, because
>> it makes the whole “~/.xsession” thing more explicit.  However, it would
>> break other DMs that don’t install a “custom.desktop”.  Maybe we could
>> integrate it into all DMs at the service level.
>>
>> The quicker workaround is to keep the current logic, and install the
>> following with GDM:
>>
>>     [Desktop Entry]
>>     Encoding=UTF-8
>>     Type=Application
>>     Name=Fail
>>     Comment=This session always fails.
>>     NoDisplay=true
>>     Exec=false
>>
>> This way, GDM fails cleanly when there are no “.desktop” files.  It
>> doesn’t show up in the list, either (“NoDisplay=true”), so everything
>> just kinda works as expected without any visible changes.
>
> I have a slight preference for the hack you propose Timothy, at least in
> the short term, because it seems less likely to break anything than
> fiddling with “Exec=custom” and all that.
>
> Anyway, it’d be great if one of you could push a fix by 1.0.  :-)

Pushed as 8caa458953eeac783c73a0e5aaa72842fe3914c9.

I’m closing the bug and the patch.  If we want to change the “xinitrc”
script to understand “custom”, we can start a new discussion to figure
out the best way to do it after 1.0.


-- Tim




Information forwarded to bug-guix <at> gnu.org:
bug#35068; Package guix. (Sat, 27 Apr 2019 16:28:01 GMT) Full text and rfc822 format available.

Message #43 received at 35068-done <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Courtès <ludo <at> gnu.org>
To: Timothy Sample <samplet <at> ngyro.com>
Cc: Danny Milosavljevic <dannym <at> scratchpost.org>, 35068-done <at> debbugs.gnu.org,
 35377-done <at> debbugs.gnu.org
Subject: Re: bug#35068: GDM crashes when it cannot find any .desktop files
Date: Sat, 27 Apr 2019 18:27:04 +0200
Timothy Sample <samplet <at> ngyro.com> skribis:

> Pushed as 8caa458953eeac783c73a0e5aaa72842fe3914c9.

Thanks!

> I’m closing the bug and the patch.  If we want to change the “xinitrc”
> script to understand “custom”, we can start a new discussion to figure
> out the best way to do it after 1.0.

Sounds good.

Ludo’.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Sun, 26 May 2019 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 329 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.