Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 10-12-2005, 07:40 AM   #1
LQ Newbie
Registered: Sep 2005
Posts: 20

Rep: Reputation: 0
Start RealVNC at boot using init.d

I have searched hundreds of forums and tried several things however I keep winding up with a problem in one way or another. (Note- I am using RealVNC, not the vnc that comes with Fedora)

I am just trying to start my vnc server when the computer boots. I have created a file called vnc in my /etc/init.d
#! /bin/sh
export USER="root"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11"
    su - $USER -c"vncserver :3"
    su - $USER -c"vncserver -clean -kill :3"
case "$1" in
        echo -n "Starting Xvnc: "
        echo -n "Stopping Xvnc "
        echo -n "Restarting Xvnc "
        echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
        exit 1
exit 0
Then I ran the folowing
ln -s /etc/init.d/boot.vnc /etc/rc0.d/K99vnc
ln -s /etc/init.d/boot.vnc /etc/rc1.d/S99vnc
ln -s /etc/init.d/boot.vnc /etc/rc2.d/S99vnc
ln -s /etc/init.d/boot.vnc /etc/rc3.d/S99vnc
ln -s /etc/init.d/boot.vnc /etc/rc4.d/S99vnc
ln -s /etc/init.d/boot.vnc /etc/rc5.d/S99vnc
ln -s /etc/init.d/boot.vnc /etc/rc6.d/K99vnc
And when I restart my comptuer it says 'Starting VNC' and i get a green 'OK' and a few seconds later I get
su: /bin/bash Permission Denied
I get the same results when I change USER="root" to my username.

If I run
[root@intrepid init.d]# bash vnc start
Starting Xvnc:
New 'intrepid.federation:3 (root)' desktop is intrepid.federation:3

Starting applications specified in /root/.vnc/xstartup
Log file is /root/.vnc/intrepid.federation:3.log

[root@intrepid init.d]#
The VNC server starts fine. This would lead me to believe the code is correct. Why do I get Permission Denied at boot?
Old 10-12-2005, 10:30 AM   #2
Senior Member
Registered: Oct 2003
Posts: 2,615

Rep: Reputation: 226Reputation: 226Reputation: 226
The X server has to be up and running before you can start the VNC server. When init.d scripts run, X is not up. I think that's your problem; you're trying to start VNC too early. This would also explain why your script works when you run it after booting up; X is up and running at that time.
I'm not that familiar with fedora, but I think you need to add your script someplace like /etc/X11/xinit.d. I'm also not that familiar with gnome, but it may have a way of autostarting scripts/programs when it first comes up. In fact, I'm fairly certain that gnome has some way to do that. That would be where I would look.
Old 10-12-2005, 04:07 PM   #3
LQ Newbie
Registered: Dec 2004
Posts: 21

Rep: Reputation: 15
The X server has to be up and running before you can start the VNC server
This most certainly is not true. VNC runs its own X server.

Fedora/Redhat already have vnc startup scripts in /etc/init.d Why can't you use that script but change it to use your version of VNC?

Old 10-14-2005, 07:58 AM   #4
LQ Newbie
Registered: Sep 2005
Posts: 20

Original Poster
Rep: Reputation: 0

Well, I was trying to learn something about linux by installing and configuring a program my self instead of just letting it install its self and add all the scripts for me. But I have been searching for over 2 weeks now and no one can tell me how to start the downloaded rpm version of RealVNC using rc.local or inid.d so I have uninstalled it and installed the vnc that comes with Fedora.
rpm -e vnc
I then modifed /etc/sysconfig/vncservers by uncommenting the lines.

VNCSERVERARGS[3]="-geometry 800x600"
Rebooted and it works fine.

Here is a good site that explains how to do this on Fedora.

If anyone knows how to do what I was trying to do please respond. I would still like to learn how to do things manualy.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
INIT failing to start dubya Fedora 3 04-25-2005 06:59 PM
To start init 2 at boot satimis Fedora 3 10-05-2004 04:02 AM
Boot into / start in INIT 3 svarreby Fedora 3 02-16-2004 09:11 AM
start services at init.d mikeshn Linux - General 1 12-24-2002 05:43 PM
INIT problem, won't start x bulliver Linux - General 7 11-06-2002 11:42 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:03 PM.

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