[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: "No protocol specified" when starting X programs from a script
From:       Tino Keitel <tino.keitel+xorg () tikei ! de>
Date:       2011-04-29 7:45:14
Message-ID: 20110429074514.GA16114 () mac ! home
[Download RAW message or body]

On Thu, Apr 28, 2011 at 11:11:23 -0700, Alan Coopersmith wrote:
> On 04/28/11 12:27 AM, Tino Keitel wrote:
> > Hi,
> > 
> > I try to start an X application from a script, which is not called from
> > X. This works with the Xfce desktop, but does not with Gnome3.
> > 
> > The script sets DISPLAY=:0 and HOME to the user that owns the X
> > session. The application is started with user and group permissions for
> > the user that owns the X session.
> > 
> > Here is the strace output that causes the error:
> > 
> > socket(PF_FILE, SOCK_STREAM|SOCK_CLOEXEC, 0) = 3
> > connect(3, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, 20) = 0
> > getpeername(3, {sa_family=AF_FILE, path=@"/tmp/.X11-unix/X0"}, [20]) =
> > 0
> > uname({sys="Linux", node="mac", ...})   = 0
> > access("/home/scorpion/.Xauthority", R_OK) = 0
> > open("/home/scorpion/.Xauthority", O_RDONLY) = 4
> > 
> > Any hints what I'm doing wrong?
> 
> You're using GNOME 3, specifically the new gdm, which doesn't put the xauth
> cookie into $HOME/.Xauthority, so that programs outside your session can't
> connect to it.
> 
> You could run 'xhost +si:localuser:scorpion' in your gnome session, so that
> the xauth cookie isn't required for local connections from your uid.

Thanks Julien and Alan. I decieded to use the most current xauth
database for the user currently logged in (`ls -d --sort=time
/var/run/gdm3/auth-for-$XUSER-* | head -n 1`/database) for XAUTHORITY,
which works fine.

Regards,
Tino
_______________________________________________
xorg@lists.freedesktop.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: http://lists.freedesktop.org/mailman/listinfo/xorg
Your subscription address: freedesktop-xorg@progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic