Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 533456 - x11-misc/lightdm-1.13.0 - Pass session arguments to dbus xinitrc launcher
Summary: x11-misc/lightdm-1.13.0 - Pass session arguments to dbus xinitrc launcher
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement (vote)
Assignee: Markos Chandras (RETIRED)
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-12-24 13:50 UTC by Joakim Tjernlund
Modified: 2015-01-16 19:38 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Xsession patch (Xsession.patch,392 bytes, patch)
2014-12-24 13:50 UTC, Joakim Tjernlund
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joakim Tjernlund 2014-12-24 13:50:31 UTC
Created attachment 392320 [details, diff]
Xsession patch

If Xsession is modified as follows:
--- Xsession.org	2014-12-24 14:42:48.790216892 +0100
+++ Xsession	2014-12-24 14:43:52.604488176 +0100
@@ -41,6 +41,9 @@
 
 unset XKB_IN_USE
 
+#Make DBUS start optimally
+command=$@
+
 # Run all system xinitrc shell scripts.
 xinitdir="/etc/X11/xinit/xinitrc.d"
 if [ -d "$xinitdir" ]; then
@@ -66,4 +69,4 @@
 
 echo "X session wrapper complete, running session $@"
 
-exec $@
+exec $command

dbus-lanch will start the session as recomended.
See /etc/X11/xinit/xinitrc.d/80-dbus

(Patch attached as well)
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-25 09:42:18 UTC
I don't see what "Make DBUS start optimally" means.
Comment 2 Joakim Tjernlund 2014-12-25 11:37:34 UTC
This makes dbus-launch start yoru X session like
  dbus-launch --exit-with-session gnome-session
instead of just
  dbus-launch --sh-syntax --exit-with-session
which less preferred according to "man dbus-launch"
Comment 3 Markos Chandras (RETIRED) gentoo-dev 2015-01-11 13:12:25 UTC
Such patches should be discussed with upstream
Comment 4 Joakim Tjernlund 2015-01-11 13:39:29 UTC
How du you figure that?
Xsession is a Gentoo adaptaion.
Comment 5 Markos Chandras (RETIRED) gentoo-dev 2015-01-11 19:10:37 UTC
How do you know that? In what Xsession file are you referring to?

~ $ qlist lightdm|grep Xsession
/etc/lightdm/Xsession

I am referring to this one
Comment 6 Joakim Tjernlund 2015-01-11 19:34:57 UTC
(In reply to Markos Chandras from comment #5)
> How do you know that? In what Xsession file are you referring to?
> 
> ~ $ qlist lightdm|grep Xsession
> /etc/lightdm/Xsession
> 
> I am referring to this one

Me too, this file is Gentoo made and is copied from the lightdm's
files/Xsession

BTW, I Googled "dbus-launch xsession" and every relevant hit
starts dbus-launch like I suggest.
Comment 7 Joakim Tjernlund 2015-01-11 20:19:24 UTC
(In reply to Joakim Tjernlund from comment #6)
> (In reply to Markos Chandras from comment #5)
> > How do you know that? In what Xsession file are you referring to?
> > 
> > ~ $ qlist lightdm|grep Xsession
> > /etc/lightdm/Xsession
> > 
> > I am referring to this one
> 
> Me too, this file is Gentoo made and is copied from the lightdm's
> files/Xsession
> 
> BTW, I Googled "dbus-launch xsession" and every relevant hit
> starts dbus-launch like I suggest.

Had a look at gdm too and it has in its Xsession.in:
  command="$@"

Note the "", perhaps add these, just to be safe?
Comment 8 Markos Chandras (RETIRED) gentoo-dev 2015-01-11 21:37:32 UTC
(In reply to Joakim Tjernlund from comment #6)
> (In reply to Markos Chandras from comment #5)
> > How do you know that? In what Xsession file are you referring to?
> > 
> > ~ $ qlist lightdm|grep Xsession
> > /etc/lightdm/Xsession
> > 
> > I am referring to this one
> 
> Me too, this file is Gentoo made and is copied from the lightdm's
> files/Xsession

ok i see what you mean now
Comment 9 Markos Chandras (RETIRED) gentoo-dev 2015-01-11 22:18:22 UTC
(In reply to Joakim Tjernlund from comment #0)
> Created attachment 392320 [details, diff] [details, diff]
> Xsession patch
> 
> If Xsession is modified as follows:
> --- Xsession.org	2014-12-24 14:42:48.790216892 +0100
> +++ Xsession	2014-12-24 14:43:52.604488176 +0100
> @@ -41,6 +41,9 @@
>  
>  unset XKB_IN_USE
>  
> +#Make DBUS start optimally
> +command=$@
> +
>  # Run all system xinitrc shell scripts.
>  xinitdir="/etc/X11/xinit/xinitrc.d"
>  if [ -d "$xinitdir" ]; then
> @@ -66,4 +69,4 @@
>  
>  echo "X session wrapper complete, running session $@"
>  
> -exec $@
> +exec $command
> 
> dbus-lanch will start the session as recomended.
> See /etc/X11/xinit/xinitrc.d/80-dbus
> 
> (Patch attached as well)

I don't understand your patch. You preserved the arguments in the command variable, and you use that later on in the exec. Why would you do that? Nothing seems to mess with the input arguments. Can you explain the sequence you see in your system that is failing and how your patch is fixing it?
Comment 10 Joakim Tjernlund 2015-01-11 22:21:39 UTC
(In reply to Markos Chandras from comment #9)
> (In reply to Joakim Tjernlund from comment #0)
> > Created attachment 392320 [details, diff] [details, diff] [details, diff]
> > Xsession patch
> > 
> > If Xsession is modified as follows:
> > --- Xsession.org	2014-12-24 14:42:48.790216892 +0100
> > +++ Xsession	2014-12-24 14:43:52.604488176 +0100
> > @@ -41,6 +41,9 @@
> >  
> >  unset XKB_IN_USE
> >  
> > +#Make DBUS start optimally
> > +command=$@
> > +
> >  # Run all system xinitrc shell scripts.
> >  xinitdir="/etc/X11/xinit/xinitrc.d"
> >  if [ -d "$xinitdir" ]; then
> > @@ -66,4 +69,4 @@
> >  
> >  echo "X session wrapper complete, running session $@"
> >  
> > -exec $@
> > +exec $command
> > 
> > dbus-lanch will start the session as recomended.
> > See /etc/X11/xinit/xinitrc.d/80-dbus
> > 
> > (Patch attached as well)
> 
> I don't understand your patch. You preserved the arguments in the command
> variable, and you use that later on in the exec. Why would you do that?
> Nothing seems to mess with the input arguments. Can you explain the sequence
> you see in your system that is failing and how your patch is fixing it?

ahh, see /etc/X11/xinit/xinitrc.d/80-dbus 
#!/bin/bash

# launches a session dbus instance

dbuslaunch="`which dbus-launch 2>/dev/null`"
if [ -n "$dbuslaunch" ] && [ -x "$dbuslaunch" ] && [ -z "$DBUS_SESSION_BUS_ADDRESS" ]; then
  if [ -n "$command" ]; then
    command="$dbuslaunch --exit-with-session $command"
  else
    eval `$dbuslaunch --sh-syntax --exit-with-session`
  fi
fi
Comment 11 Markos Chandras (RETIRED) gentoo-dev 2015-01-12 19:50:19 UTC
+  12 Jan 2015; Markos Chandras <hwoarang@gentoo.org> files/Xsession:
+  Pass Xsession arguments to xinitrc.d/80-dbus. Bug #533456. Thanks to Joakim
+  Tjernlund <Joakim.Tjernlund@transmode.se> for the patch
+
Comment 12 Raffaello D. Di Napoli 2015-01-16 00:31:51 UTC
Markos, the patch (as of rev 1.2 of files/Xsession) is broken. By doing

   exec "$command"

you’re trying to launch a process named “dbus-launch --exit-with-session gnome-session”, which of course does not exist, so the exec fails with “path not found” and brings you directly back to the greeter.
The exec statement as suggested by Joakim, on the other hand, works:

   exec $command

by letting the shell split $command appropriately.

As a side note, shouldn’t this change warrant a -r1 bump? I was very confused when I run into this error (unable to login due to the broken exec call) on a machine I setup yesterday, but the very same version of lightdm was working just fine on two other machines, and cost me a lot of wasted time inspecting configs and reinstalling packages.
Comment 13 Markos Chandras (RETIRED) gentoo-dev 2015-01-16 19:38:16 UTC
(In reply to Raffaello D. Di Napoli from comment #12)
> Markos, the patch (as of rev 1.2 of files/Xsession) is broken. By doing
> 
>    exec "$command"
> 
> you’re trying to launch a process named “dbus-launch --exit-with-session
> gnome-session”, which of course does not exist, so the exec fails with “path
> not found” and brings you directly back to the greeter.
> The exec statement as suggested by Joakim, on the other hand, works:
> 
>    exec $command
> 
> by letting the shell split $command appropriately.
> 
> As a side note, shouldn’t this change warrant a -r1 bump? I was very
> confused when I run into this error (unable to login due to the broken exec
> call) on a machine I setup yesterday, but the very same version of lightdm
> was working just fine on two other machines, and cost me a lot of wasted
> time inspecting configs and reinstalling packages.

Thanks. Fixed. Well i'd rather not revbump anything at the moment. hopefully only a minimal number of users will be affected.