1

There are some pages about timeout in locking authority file /root/.xauth but I really don't understand what is the root of the problem.

As I start vnc service, I see:

root@cluster:mahmood# /etc/init.d/vncserver start Starting VNC server: 1:vahidms xauth: timeout in locking authority file /root/.xauthVdNayr New 'cluster.scu:1 (vahidms)' desktop is cluster.scu:1 Starting applications specified in /home/vahidms/.vnc/xstartup Log file is /home/vahidms/.vnc/cluster.scu:1.log 

Although the command is run by root, but it seems that it wants to access /root/.xauthVdNayr on behalf of /home/vahidms (a user).

So, why?

UPDATE 1 Please see the output of the commands as stated in the answer

root@cluster:~# ls -l /etc/init.d/vncserver -rwxr-xr-x 1 root root 3126 Dec 8 2011 /etc/init.d/vncserver root@cluster:~# grep -i xauth /etc/init.d/vncserver root@cluster:~# env | grep XAUTHORITY root@cluster:~# su - vahidms vahidms@cluster:~$ env | grep XAUTHORITY vahidms@cluster:~$ exit logout root@cluster:~# lslocks -bash: lslocks: command not found 

UPDATE 2

Please see the related output. I wonder why the lslocks command is not available.

root@cluster:~# yum list | grep util-linux-ng.x86_64 util-linux-ng.x86_64 2.17.2-12.18.el6 @base root@cluster:~# find / -name lslocks root@cluster:~# grep -i xauth /usr/bin/vncserver $xauth = "xauth"; $xauthorityFile = "$ENV{XAUTHORITY}" || "$ENV{HOME}/.Xauthority"; open (XAUTH, "|xauth -f $xauthorityFile source -"); print XAUTH "add $host:$displayNumber . $cookie\n"; print XAUTH "add $host/unix:$displayNumber . $cookie\n"; close XAUTH; $cmd .= " -auth $xauthorityFile"; if (-x "/usr/X11R6/bin/xauth") { $xauth = "/usr/X11R6/bin/xauth"; foreach $cmd ("xauth") { root@cluster:~# grep -i env /etc/init.d/vncserver root@cluster:~# grep -i env /etc/rc.d/init.d/vncserver root@cluster:~# 

Any idea?

1 Answer 1

1

vncserver is a perl script, so you look inside to see that it runs xauth to add a newly created random MIT-MAGIC-COOKIE-1 value (got from mcookie) for the server it is about to start. By default it tells xauth to use the file ~/.Xauthority, but you seem to have set XAUTHORITY=/root/.xauthVdNayr in your environment, and this takes precedence.

The authority file to use is normally in the home directory of the user that will be creating clients for the server.

You are probably inheriting the XAUTHORITY from xdm or some similar display manager, and it is probably the process that has locked the file. Use command lslocks to list which commands have which files locked.

You can simply unset the XAUTHORITY environment variable so that the default file is used.

3
  • Please see the updated post Commented May 25, 2016 at 18:33
  • I'm assuming /etc/init.d/vncserver runs /usr/bin/vncserver or similar. I have fedora 22 which I thought would be similar in some ways with centos. You need to check the env inside /etc/init.d/vncserver for XAUTHORITY. You might find lslocks in the package util-linux. Commented May 25, 2016 at 18:43
  • Please see the updated post. Any more idea? Commented May 25, 2016 at 20:24

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.