Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Feb 2006 11:49:59 -0500
From:      Bob Perry <rperry@gti.net>
To:        freebsd-x11@freebsd.org, Scott Robbins <scottro@nyc.rr.com>
Subject:   Follow-Up Re: Unable to Startx Following Upgrade--Error in, Locking Authority File
Message-ID:  <43F8A1B7.9010001@gti.net>

next in thread | raw e-mail | index | archive | help
-------- Original Message --------
Subject: Re: Unable to Startx Following Upgrade--Error in,Locking
Authority File
Date: Thu, 16 Feb 2006 21:49:10 -0500
From: Bob Perry <rperry@gti.net>
To: Bob Perry <rperry@gti.net>,  freebsd-x11@freebsd.org
References: <43F40518.8000003@gti.net>
<20060216055405.GB6213@mail.scottro.net>

Scott Robbins wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> On Wed, Feb 15, 2006 at 11:52:40PM -0500, Bob Perry wrote:
> 
> 
>>>    Xlib: No protocol specified
>>> I have no problem running startx as root.
> 
> I wrote:
> 
>  
>>> I had a similar problem, although in my case, I suspect it's due to some
>>> cheap hardware.
>>>
>>> At any rate, before starting X try
>>> xauth -b quit
>>>
>>> This will break any locks.  (If your problem has similar causes as mine
>>> did, there will be an .Xauthority, and a couple of others--.Xauthority-c
>>> and .Xauthority-l, if I remember correctly.)
> 
> 
> 
> 
>> Hi Scott,
>> I ran the command, xauth -b quit, but no change.  You are correct however, in 
>> that two files, .Xauthority-c and .Xauthority-l, were present.  Now only 
>> .Xauthority remains.
>>
>> Not sure what my next steps are.
>>
>> Bob
> 
> 
> Hrrm, I'm not sure either.  The xauth -b quit should remove those two
> files.


It did.

   It was explained to me on this list that they're lock files
> that weren't properly removed.
> 
> Also, I missed that you could run it as root, which means it probably
> has a different cause.  It's probably some silly permissions issue that
> we're overlooking.   
> 
I need to review .Xauthority and see what it's all about.  Hopefully,
I'll find the answer soon.

Thanks again,

Scott,
You may have been right about the "silly permissions".

Google offered up the man page for the Linux mkxauth command as a 
possible explanation of .Xauthority.  Apparently, the .Xauthority files 
function as an authentication database and new users must have one.

According to the man page:
"To create a .Xauthority file, use mkxauth -c (see (1) above). mkxauth 
creates a .Xauthority file in the user's home directory (~/), containing 
a `key' or `magic cookie' for the host it was run on (the one returned 
by hostname(1)). If a .Xauthority file already exists, the keys are 
added to it. If keys for that host already exist, they are replaced."

In my case, the existing .Xauthority file in my home directory was 
readable and writable only by root (although rperry was shown as group 
id) and startx complained about writing to it (unless you were root).  I 
added rw permissions to group and was able to access my gnome session.

I also found that following this action, the .Xauthority file in my home 
directory changed as follows:
	-rw------- 1 rperry rperry   109 Feb 19 09:21 .Xauthority

My desktop session was basically the same except Thunderbird, my mail 
client, demanded I set up a new Mail account and of course, my old mail 
files are missing.

Up to this point, I was preparing this note as a possible solution but 
I ran startx again as root, then tried again as rperry and it failed.
Also noted that the .Xauthority file in my home directory had once again 
been modified.  It is now back to the original as:
	-rw------- 1 root rperry  0  Feb 19 10:25  .Xauthority

What I failed to realize was that when substituting the root identity, I 
used su -m which does not change (HOME) the directory.  Therefore, when 
running startx as root, the root .Xauthority is changed in my home 
directory with root permissions and file identity and startx has 
difficulty dealing with that when rperry wants to run startx.

No more su -m to run startx as root.

I rarely ran startx as root in the past but when I did I don't remember 
ever having a problem like this.  Therefore I do not offer this as a 
solution but it does help me somewhat.

Just a little whizzed now that I have to find my Thunderbird e-mail files.

Bob Perry




	



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?43F8A1B7.9010001>