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
Code:
#! /bin/sh
export USER="root"
export PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11"
NAME=vnc
start()
{
su - $USER -c"vncserver :3"
}
stop()
{
su - $USER -c"vncserver -clean -kill :3"
}
case "$1" in
start)
echo -n "Starting Xvnc: "
start
;;
stop)
echo -n "Stopping Xvnc "
stop
;;
restart)
restart)
echo -n "Restarting Xvnc "
stop
start
;;
*)
echo "Usage: /etc/init.d/$NAME {start|stop|restart}"
exit 1
;;
esac
exit 0
Then I ran the folowing
Code:
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
Code:
su: /bin/bash Permission Denied
I get the same results when I change
USER="root" to my username.
If I run
Code:
[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?