LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat
User Name
Password
Red Hat This forum is for the discussion of Red Hat Linux.

Notices


Reply
  Search this Thread
Old 04-11-2006, 03:32 AM   #1
colazhang
LQ Newbie
 
Registered: Apr 2006
Posts: 1

Rep: Reputation: 0
Unhappy 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!!
 
Old 04-11-2006, 05:47 AM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
The line near the top that reads chkconfig: - 91 35 seems to say that it won't start at boot time. Have a look in man chkconfig - I think the commands you want are something like chkconfig --list vncserver to see what run levels it runs in, chkconfig --add vncserver to have the server controlled by chkconfig, chkconfig --levels 2345 on vncserver to set the levels and service vncserver start to start the server.

Please read the man page for chkconfig carefully as I haven't used the command in over 6 months and don't have a box here to check it with.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
VNC server not working tungaw2001 Linux - Hardware 1 02-21-2006 05:19 AM
YAOSP (yet another opensuse prob) -vnc this time mattl SUSE / openSUSE 0 12-30-2005 08:53 PM
Start VNC at boot time hlpboplz Linux - Newbie 13 05-25-2005 03:55 PM
VNC server not working teodavinci Fedora - Installation 3 04-16-2004 05:48 PM
Previously working vnc... no longer working marsonist Linux - Networking 1 01-21-2004 07:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Red Hat

All times are GMT -5. The time now is 05:01 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration