timeout in locking authority file (vnc service)












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 . $cookien";
print XAUTH "add $host/unix:$displayNumber . $cookien";
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?










share|improve this question





























    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 . $cookien";
    print XAUTH "add $host/unix:$displayNumber . $cookien";
    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?










    share|improve this question



























      1












      1








      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 . $cookien";
      print XAUTH "add $host/unix:$displayNumber . $cookien";
      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?










      share|improve this question
















      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 . $cookien";
      print XAUTH "add $host/unix:$displayNumber . $cookien";
      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?







      centos vnc xauth






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited May 25 '16 at 20:23







      mahmood

















      asked May 25 '16 at 9:17









      mahmoodmahmood

      3702822




      3702822






















          1 Answer
          1






          active

          oldest

          votes


















          0














          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.






          share|improve this answer
























          • Please see the updated post

            – mahmood
            May 25 '16 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.

            – meuh
            May 25 '16 at 18:43











          • Please see the updated post. Any more idea?

            – mahmood
            May 25 '16 at 20:24











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "106"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f285352%2ftimeout-in-locking-authority-file-vnc-service%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          0














          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.






          share|improve this answer
























          • Please see the updated post

            – mahmood
            May 25 '16 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.

            – meuh
            May 25 '16 at 18:43











          • Please see the updated post. Any more idea?

            – mahmood
            May 25 '16 at 20:24
















          0














          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.






          share|improve this answer
























          • Please see the updated post

            – mahmood
            May 25 '16 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.

            – meuh
            May 25 '16 at 18:43











          • Please see the updated post. Any more idea?

            – mahmood
            May 25 '16 at 20:24














          0












          0








          0







          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered May 25 '16 at 17:17









          meuhmeuh

          32.4k12054




          32.4k12054













          • Please see the updated post

            – mahmood
            May 25 '16 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.

            – meuh
            May 25 '16 at 18:43











          • Please see the updated post. Any more idea?

            – mahmood
            May 25 '16 at 20:24



















          • Please see the updated post

            – mahmood
            May 25 '16 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.

            – meuh
            May 25 '16 at 18:43











          • Please see the updated post. Any more idea?

            – mahmood
            May 25 '16 at 20:24

















          Please see the updated post

          – mahmood
          May 25 '16 at 18:33





          Please see the updated post

          – mahmood
          May 25 '16 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.

          – meuh
          May 25 '16 at 18:43





          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.

          – meuh
          May 25 '16 at 18:43













          Please see the updated post. Any more idea?

          – mahmood
          May 25 '16 at 20:24





          Please see the updated post. Any more idea?

          – mahmood
          May 25 '16 at 20:24


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Unix & Linux Stack Exchange!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f285352%2ftimeout-in-locking-authority-file-vnc-service%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to make a Squid Proxy server?

          Is this a new Fibonacci Identity?

          19世紀