vine-users ML アーカイブ



[vine-users:069304] ブート時 にVNCサーバ 起動でエラー「A VNC server is already running as :1」

  • From: "KMochida" <kaormchd@xxxxxxxxxxxxxxxxxxx>
  • Subject: [vine-users:069304] ブート時 にVNCサーバ 起動でエラー「A VNC server is already running as :1」
  • Date: Tue, 21 Dec 2004 19:02:00 +0900
KMochidaと申します。宜しくお願い致します。

vine3.1に
http://www.ring.gr.jp/pub/linux/Vine/apt/3.1/i386/RPMS.plus/vnc-server-4.0-0.0.beta4.11vl1.i386.rpm
http://www.ring.gr.jp/pub/linux/Vine/apt/3.1/i386/RPMS.plus/vnc-doc-3.3.3r2-26vl5.i386.rpm
http://www.ring.gr.jp/pub/linux/Vine/apt/3.1/i386/RPMS.plus/vnc-4.0-0.0.beta4.11vl1.i386.rpm
をインストールしました。

# rpm -qa | grep vnc
vnc-server-4.0-0.0.beta4.11vl1
vnc-4.0-0.0.beta4.11vl1
vnc-doc-3.3.3r2-39.2

起動用ファイルは

# cat /etc/rc.d/init.d/vncserver
#!/bin/bash -x
. /etc/init.d/functions
. /etc/sysconfig/network
[ ${NETWORKING} = "no" ] && exit 0
VNCSERVERS=""
[ -f /etc/sysconfig/vncservers ] && . /etc/sysconfig/vncservers
prog=$"VNC server"
start() {
    echo -n $"Starting $prog: "
    ulimit -S -c 0 >/dev/null 2>&1
    RETVAL=0
    for display in ${VNCSERVERS}
    do
        echo -n "${display} "
unset BASH_ENV ENV
export USER="${display##*:}"
        initlog $INITLOG_ARGS -c \
            "su ${USER} -c \"cd ~${USER} && [ -f .vnc/passwd ] && vncserver
:${display%%:*}\""
        RETVAL=$?
        [ "$RETVAL" -ne 0 ] && break
    done
    [ "$RETVAL" -eq 0 ] && success $"vncserver startup" || \
        failure $"vncserver start"
    echo
    [ "$RETVAL" -eq 0 ] && touch /var/lock/subsys/vncserver
}
stop() {
    echo -n $"Shutting down $prog: "
    for display in ${VNCSERVERS}
    do
        echo -n "${display} "
unset BASH_ENV ENV
export USER="${display##*:}"
        initlog $INITLOG_ARGS -c \
    "su ${USER} -c \"vncserver -kill :${display%%:*}\" >/dev/null 2>&1"
    done
    RETVAL=$?
    [ "$RETVAL" -eq 0 ] && success $"vncserver shutdown" || \
        failure $"vncserver shutdown"
    echo
    [ "$RETVAL" -eq 0 ] && rm -f /var/lock/subsys/vncserver
}
case "$1" in
  start)
start
;;
  stop)
stop
;;
  restart|reload)
stop
sleep 3
start
;;
  condrestart)
if [ -f /var/lock/subsys/vncserver ]; then
    stop
    sleep 3
    start
fi
;;
  status)
status Xvnc
;;
  *)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
exit 1
esac

となっています。そして、各設定ファイルは

# cat /etc/sysconfig/vncservers | grep -v ^#
VNCSERVERS="1:root 2:user01"
VNCSERVERARGS[1]="-geometry 800x600"
VNCSERVERARGS[2]="-geometry 800x600 -depth 24"

# cat /root/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset SESSION_MANEGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

# cat /home/user01/.vnc/xstartup
#!/bin/sh
# Uncomment the following two lines for normal desktop:
# unset SESSION_MANAGER
# exec /etc/X11/xinit/xinitrc
unset SESSION_MANEGER
exec /etc/X11/xinit/xinitrc
[ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup
[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
xsetroot -solid grey
vncconfig -iconic &
xterm -geometry 80x24+10+10 -ls -title "$VNCDESKTOP Desktop" &
twm &

としています。その後、
# service vncserver start

で無事起動出来ましたがブート時には自動起動できません。
下記のようなエラー「rc: Starting vncserver:  failed」に見舞われてしまいま
す。

Dec 21 15:05:21 vine3_1 nfs: rpc.mountd startup succeeded
Dec 21 15:05:21 vine3_1 vncserver: + . /etc/init.d/functions
Dec 21 15:05:21 vine3_1 vncserver: ++ TEXTDOMAIN=initscripts
Dec 21 15:05:21 vine3_1 vncserver: ++ TEXTDOMAINDIR=/etc/locale
Dec 21 15:05:21 vine3_1 vncserver: ++ umask 022
Dec 21 15:05:21 vine3_1 vncserver: ++ export
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
Dec 21 15:05:21 vine3_1 vncserver: ++
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/usr/X11R6/bin
Dec 21 15:05:21 vine3_1 vncserver: ++ '[' -z '' ']'
Dec 21 15:05:21 vine3_1 vncserver: ++ COLUMNS=80
Dec 21 15:05:21 vine3_1 vncserver: ++ '[' -f /etc/sysconfig/i18n -a -z ''
']'
Dec 21 15:05:21 vine3_1 vncserver: ++ . /etc/sysconfig/i18n
Dec 21 15:05:21 vine3_1 vncserver: +++ LANG=ja_JP.eucJP
Dec 21 15:05:21 vine3_1 vncserver: +++ /sbin/consoletype
Dec 21 15:05:21 vine3_1 vncserver: ++ '[' ja_JP.eucJP = ja_JP.eucJP -a vt
'!=' pty ']'
Dec 21 15:05:21 vine3_1 vncserver: ++ export LANG
Dec 21 15:05:21 vine3_1 vncserver: ++ export LC_MESSAGES=C
Dec 21 15:05:21 vine3_1 vncserver: ++ LC_MESSAGES=C
Dec 21 15:05:22 vine3_1 vncserver: ++ export LC_TIME=C
Dec 21 15:05:22 vine3_1 vncserver: ++ LC_TIME=C
Dec 21 15:05:22 vine3_1 vncserver: ++ '[' -z '' ']'
Dec 21 15:05:22 vine3_1 vncserver: ++ '[' -f /etc/sysconfig/init ']'
Dec 21 15:05:22 vine3_1 vncserver: ++ . /etc/sysconfig/init
Dec 21 15:05:22 vine3_1 vncserver: +++ BOOTUP=color
Dec 21 15:05:23 vine3_1 vncserver: +++ RES_COL=60
Dec 21 15:05:23 vine3_1 vncserver: +++ MOVE_TO_COL=echo -en \033[60G
Dec 21 15:05:23 vine3_1 vncserver: +++ SETCOLOR_SUCCESS=echo -en \033[1;32m
Dec 21 15:05:23 vine3_1 vncserver: +++ SETCOLOR_FAILURE=echo -en \033[1;31m
Dec 21 15:05:23 vine3_1 vncserver: +++ SETCOLOR_WARNING=echo -en \033[1;33m
Dec 21 15:05:24 vine3_1 vncserver: +++ SETCOLOR_NORMAL=echo -en \033[0;39m
Dec 21 15:05:24 vine3_1 vncserver: +++ LOGLEVEL=3
Dec 21 15:05:24 vine3_1 vncserver: +++ PROMPT=yes
Dec 21 15:05:24 vine3_1 vncserver: ++ '[' -x /sbin/consoletype ']'
Dec 21 15:05:25 vine3_1 vncserver: +++ consoletype
Dec 21 15:05:26 vine3_1 su:
Dec 21 15:05:26 vine3_1 vncserver: ++ '[' vt = serial ']'
Dec 21 15:05:26 vine3_1 su: Warning: vine3_1:1 is taken because of
/tmp/.X11-unix/X1
Dec 21 15:05:27 vine3_1 vncserver: ++ '[' color '!=' verbose ']'
Dec 21 15:05:27 vine3_1 su: Remove this file if there is no X server
vine3_1:1
Dec 21 15:05:27 vine3_1 vncserver: ++ INITLOG_ARGS=-q
Dec 21 15:05:27 vine3_1 su: A VNC server is already running as :1
Dec 21 15:05:27 vine3_1 vncserver: + . /etc/sysconfig/network
Dec 21 15:05:27 vine3_1 vncserver: vncserver start failed
Dec 21 15:05:27 vine3_1 vncserver: ++ NETWORKING=yes
Dec 21 15:05:27 vine3_1 vncserver: ++ HOSTNAME=vine3_1
Dec 21 15:05:27 vine3_1 vncserver: ++ GATEWAY=192.168.1.1
Dec 21 15:05:27 vine3_1 vncserver: + '[' yes = no ']'
Dec 21 15:05:27 vine3_1 vncserver: + VNCSERVERS=
Dec 21 15:05:27 vine3_1 vncserver: + '[' -f /etc/sysconfig/vncservers ']'
Dec 21 15:05:27 vine3_1 vncserver: Starting VNC server: 1:root
Dec 21 15:05:27 vine3_1 vncserver: Warning: vine3_1:1 is taken because of
/tmp/.X11-unix/X1
Dec 21 15:05:27 vine3_1 vncserver: Remove this file if there is no X server
vine3_1:1
Dec 21 15:05:27 vine3_1 vncserver: A VNC server is already running as :1
Dec 21 15:05:27 vine3_1 vncserver:
Dec 21 15:05:27 vine3_1 vncserver: + . /etc/sysconfig/vncservers
Dec 21 15:05:27 vine3_1 vncserver: ++ VNCSERVERS=1:root 2:user01
Dec 21 15:05:27 vine3_1 vncserver: ++ VNCSERVERARGS[1]=-geometry 800x600
Dec 21 15:05:27 vine3_1 vncserver: ++ VNCSERVERARGS[2]=-geometry
800x600 -depth 24
Dec 21 15:05:27 vine3_1 vncserver: + prog=VNC server
Dec 21 15:05:27 vine3_1 vncserver: + start
Dec 21 15:05:27 vine3_1 vncserver: + echo -n 'Starting VNC server: '
Dec 21 15:05:27 vine3_1 vncserver: + ulimit -S -c 0
Dec 21 15:05:27 vine3_1 vncserver: + RETVAL=0
Dec 21 15:05:27 vine3_1 vncserver: + echo -n '1:root '
Dec 21 15:05:27 vine3_1 vncserver: + unset BASH_ENV ENV
Dec 21 15:05:28 vine3_1 vncserver: + export USER=root
Dec 21 15:05:28 vine3_1 vncserver: + USER=root
Dec 21 15:05:28 vine3_1 vncserver: + initlog -q -c 'su root -c "cd ~root &&
[ -f .vnc/passwd ] && vncserver :1"'
Dec 21 15:05:28 vine3_1 vncserver: + RETVAL=2
Dec 21 15:05:28 vine3_1 vncserver: + '[' 2 -ne 0 ']'
Dec 21 15:05:28 vine3_1 vncserver: + break
Dec 21 15:05:28 vine3_1 vncserver: + '[' 2 -eq 0 ']'
Dec 21 15:05:28 vine3_1 vncserver: + failure 'vncserver start'
Dec 21 15:05:28 vine3_1 vncserver: + rc=1
Dec 21 15:05:28 vine3_1 vncserver: + '[' -z '' ']'
Dec 21 15:05:28 vine3_1 vncserver: + initlog -q -n
/etc/rc3.d/S99vncserver -s 'vncserver start' -e 2
Dec 21 15:05:28 vine3_1 vncserver: + '[' color '!=' verbose ']'
Dec 21 15:05:28 vine3_1 vncserver: + echo_failure
Dec 21 15:05:28 vine3_1 vncserver: + '[' color = color ']'
Dec 21 15:05:28 vine3_1 vncserver: + echo -en '\033[60G'
Dec 21 15:05:28 vine3_1 vncserver: + echo -n '['
Dec 21 15:05:28 vine3_1 vncserver: + '[' color = color ']'
Dec 21 15:05:28 vine3_1 vncserver: + echo -en '\033[1;31m'
Dec 21 15:05:28 vine3_1 vncserver: + echo -n FAILED
Dec 21 15:05:28 vine3_1 vncserver: + '[' color = color ']'
Dec 21 15:05:28 vine3_1 vncserver: + echo -en '\033[0;39m'
Dec 21 15:05:28 vine3_1 vncserver: + echo -n ']'
Dec 21 15:05:28 vine3_1 vncserver: + echo -ne '\r'
Dec 21 15:05:28 vine3_1 vncserver: + return 1
Dec 21 15:05:28 vine3_1 vncserver: + return 1
Dec 21 15:05:28 vine3_1 vncserver: + echo
Dec 21 15:05:28 vine3_1 vncserver: + '[' 2 -eq 0 ']'
Dec 21 15:05:29 vine3_1 rc: Starting vncserver:  failed
Dec 21 15:05:31 vine3_1 rc: Starting webmin:  succeeded

ブート完了後、手動で起動や停止をすると

# service vncserver start
VNC serverを起動中: 1:root
Warning: vine3_1:1 is taken because of /tmp/.X11-unix/X1
Remove this file if there is no X server vine3_1:1
A VNC server is already running as :1
                                                           [失敗]

# service vncserver stop
VNC serverを停止中: 1:root
Can't find file /root/.vnc/vine3_1:1.pid
You'll have to kill the Xvnc process manually
2:user01
Can't find file /home/user01/.vnc/vine3_1:2.pid
You'll have to kill the Xvnc process manually

                                                           [失敗]

となってしまいす。
どうすればブート時に起動出来るようになるのでしょうか?

__________________________________
Do You Yahoo!?
Upgrade Your Life
http://bb.yahoo.co.jp/