From mboxrd@z Thu Jan 1 00:00:00 1970 From: Timothy Sample Subject: bug#35068: GDM crashes when it cannot find any .desktop files Date: Thu, 25 Apr 2019 21:02:53 -0400 Message-ID: <87pnp97f42.fsf@ngyro.com> References: <87lg0um9qb.fsf@gnu.org> <20190420170649.30c05dbd@scratchpost.org> <20190421113749.0439cbc9@scratchpost.org> <87v9z72k3p.fsf@gnu.org> <87tvel7we1.fsf@ngyro.com> <20190425211540.3ecda900@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([209.51.188.92]:37139) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hJpHX-00083R-ON for bug-guix@gnu.org; Thu, 25 Apr 2019 21:04:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hJpHW-0004ji-3z for bug-guix@gnu.org; Thu, 25 Apr 2019 21:04:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:46113) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hJpHV-0004jE-UH for bug-guix@gnu.org; Thu, 25 Apr 2019 21:04:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hJpHV-0007FS-Lc for bug-guix@gnu.org; Thu, 25 Apr 2019 21:04:01 -0400 Sender: "Debbugs-submit" Resent-Message-ID: In-Reply-To: <20190425211540.3ecda900@scratchpost.org> (Danny Milosavljevic's message of "Thu, 25 Apr 2019 21:15:40 +0200") List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: "bug-Guix" To: Danny Milosavljevic Cc: 35068@debbugs.gnu.org Hi Danny, Oh my! I explained things very poorly. Sorry. I=E2=80=99ll provide some = more context. Danny Milosavljevic writes: > Hi Timothy, > > On Thu, 25 Apr 2019 14:49:42 -0400 > Timothy Sample wrote: > >> exploding. I did look at Danny=E2=80=99s patch (#35377), and it would w= ork, but >> it seems a little arbitrary. Nothing understands the =E2=80=9CExec=3Dcu= stom=E2=80=9D >> line, and our =E2=80=9Cxinitrc=E2=80=9D runs =E2=80=9C~/.xsession=E2=80= =9D 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 =E2=80=9C--enable-gdm-xsession=E2=80=9D to the configure script for it to b= e installed. I added this flag in 51bc8357e8457d5d7168d8837da6e14fa2d98485, but the script doesn=E2=80=99t support =E2=80=9C~/.xsession=E2=80=9D scripts, so (a= fter some discussion) I removed it in 41fa9f1815685ede0d3fdc1c561d2a9cf0ffb158. It seems that most distros use their own scripts and in turn, the GDM folks don=E2=80=99t really give much thought to =E2=80=9Cdata/Xsession.in=E2=80=9D. Furthermore (I was surprised by this), even though the =E2=80=9Cdata/Xsession.in=E2=80=9D script says that it will honour =E2=80= =9Ccustom=E2=80=9D in a comment, the code says otherwise. There=E2=80=99s a commit where support f= or it gets removed, but they must have forgotten about the comment. >> There are two workarounds. The first is to keep Danny=E2=80=99s patch a= s-is, >> but add logic to =E2=80=9Cxinitrc=E2=80=9D so that it only uses =E2=80= =9C~/.xsession=E2=80=9D 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 =E2=80=9Cxinitrc=E2=80=9D in =E2=80=9Cgnu/services/xorg.scm=E2=80=9D. Y= ou can override it from the GDM configuration record. >> break other DMs that don=E2=80=99t install a =E2=80=9Ccustom.desktop=E2= =80=9D. 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=E2=80=99t need a =E2=80=9C.desktop=E2=80=9D file currently. My pers= onal opinion is that having the existence of the =E2=80=9C~/.xsession=E2=80=9D script override y= our explicitly stated session selection when logging in is a little surprising. But if that=E2=80=99s conventional, then I=E2=80=99m happy to = follow convention. >> This way, GDM fails cleanly when there are no =E2=80=9C.desktop=E2=80=9D= files. It >> doesn=E2=80=99t show up in the list, either (=E2=80=9CNoDisplay=3Dtrue= =E2=80=9D), 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=3Dfalse 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 =E2=80=9Cxinitrc=E2=80=9D script will run your =E2=80=9C~/.x= session=E2=80=9D script if it exists, regardless of what session you select when logging in. However, GDM will crash if you do not have any =E2=80=9C.desktop=E2=80=9D files. Yo= u don=E2=80=99t really need a =E2=80=9C.desktop=E2=80=9D file for anything, but GDM goes nu= ts if it can=E2=80=99t find any. So, we could fix GDM, but that looks pretty tricky= . In lieu of that, we could provide a dummy =E2=80=9C.desktop=E2=80=9D that is i= nvisible and exists only to placate GDM when no other =E2=80=9C.desktop=E2=80=9D file ex= ists. With the dummy file, if you have a =E2=80=9C~/.xsession=E2=80=9D script, you wil= l be able to log in even if you have no other =E2=80=9C.desktop=E2=80=9D files. If you = have no =E2=80=9C.desktop=E2=80=9D files and no =E2=80=9C~/.xsession=E2=80=9D scrip= t, 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=E2=80=99s system profile does= n=E2=80=99t have >> any =E2=80=9C.desktop=E2=80=9D 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 =E2=80=9C.desktop=E2=80=9D files, everything should b= e the same. For people with no other =E2=80=9C.desktop=E2=80=9D files GDM will no longe= r go bananas, but rather let you log in using =E2=80=9C~/.xsession=E2=80=9D. > FWIW, "Exec=3Dcustom" is the way gdm itself does it. It=E2=80=99s true that most distros honour =E2=80=9Ccustom=E2=80=9D in thei= r scripts. It doesn=E2=80=99t happen at the GDM level, though (like I wrote above). > Still, ~/.xinitrc is not picked up either way--which is too bad. Isn=E2=80=99t that script specific to =E2=80=9Cstartx=E2=80=9D? (That=E2= =80=99s at least what a popular question and answer site tells me.) -- Tim