ロック権限ファイルのタイムアウト(vncサービス)

ロック権限ファイルのタイムアウト(vncサービス)

いくつかのページがありますが、timeout in locking authority file /root/.xauth問題の原因が何であるかを実際に理解していません。

vnc サービスを開始すると、次の情報が表示されます。

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

このコマンドはrootとして実行されますが、/home/vahidms(ユーザー)の代わりに/root/.xauthVdNayrにアクセスしたいようです。

なぜ?

アップデート1 答えに記載されているコマンドの出力を参照してください。

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

アップデート2

関連出力を参照してください。なぜこのlslocksコマンドが利用できないのか知りたいのですが。

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:~#  

どんなアイデアがありますか?

ベストアンサー1

vncserverxauthはPerlスクリプトなので、内部を見ると、新しく生成された任意のMIT-MAGIC-COOKIE-1値(から取得)を起動したいサーバーに追加して実行されることがわかります。mcookieデフォルトでは xauth に file を使用するように指示します~/.Xauthorityが、XAUTHORITY=/root/.xauthVdNayrご使用の環境でこれを設定したように見え、これが優先されます。

使用する権限ファイルは通常、サーバー用のクライアントを作成するユーザーのホームディレクトリにあります。

XAUTHORITYあるいは、同様のディスプレイマネージャから継承している可能性があり、xdmファイルをロックするプロセスである可能性があります。lslocksどのコマンドがどのファイルをロックしたかをリストするには、このコマンドを使用します。

unsetデフォルトファイルを使用するようにXAUTHORITY環境変数を簡単に設定できます。

おすすめ記事