vnc server at boot time not working?
Hello,everyone:
I'm a newer in Linux and just installed RedHat Linux Version 4.
It's easier to work with the user interface to configure the system just like windows. But I have found a problem with it. That is, i want the vnc server to be launched at boot time. Everytime I can only connect to the vncserver with a vncclient after logging in with a username (not necessarily "root") at the server marchine. When i close the session of this user, I lose the VNC connection and can not continue remote controls, which means I have to go to the server to log in again.
here is my diagnosis:
I have tried configuring to activate the vnc service in the services with the UI offered by RedHat and have seen a file named vncserver in the "/etc/rc.d/init.d" as well as in "/etc/init.d" with the same content as following:
---------------------------------------------------------------
#!/bin/bash
#
# chkconfig: - 91 35
# description: Starts and stops vncserver. \
# used to provide remote X administration services.
# Source function library.
. /etc/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0
unset VNCSERVERARGS
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
DISP="${display%%:*}"
export USER="${display##*:}"
export VNCUSERARGS="${VNCSERVERARGS[${DISP}]}"
initlog $INITLOG_ARGS -c \
"runuser ${USER} -c \"cd ~${USER} && [ -f .vnc/passwd ] && vncserver :${DISP} ${VNCUSERARGS}\""
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 \
"runuser ${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
}
# See how we were called.
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
----------------------------------------------------------------
It appears to be already well configured.But why it's not launched at boot time?!!!!
Thanks a lot!!
|