Debian – init.d script not working

debianinit.dvnc

I copied an init script from here quite some time ago to automatically start my tightvncserver at boot. It worked perfectly at the time. Since then, I have reformatted my computer, and now my script doesn't start automatically. If I call /etc/init.d/tightvncserver start manually via ssh, then my vnc server starts as it should… Any idea as to what's going on?

Here is my script

#!/bin/sh
# /etc/init.d/tightvncserver
# http://www.penguintutor.com/linux/tightvnc
#Set the VNCUSER variable to the name of the user to start tightvncserver
VNCUSER='jake'
case "$1" in
  start)
    su $VNCUSER -c '/usr/bin/tightvncserver :2'
    echo "Starting TightVNC server for $VNCUSER "
    ;;
  stop)
    pkill Xtightvnc
    echo "Tightvncserver stopped"
    ;;
  *)
    echo "Usage: /etc/init.d/tightvncserver {start|stop}"
    exit 1
    ;;
esac
exit 0

Best Answer

In case your init script has no symlinks in the rc*.d directories run the following to create them:

update-rc.d tightvncserver defaults
Related Topic