Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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
share|improve this question
    
What's jake's user look like? Any interesting errors on the console? Maybe echo the return code after the command is attempted? –  Shane Madden Aug 16 '12 at 23:15

2 Answers 2

up vote 3 down vote accepted

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

update-rc.d tightvncserver defaults
share|improve this answer
    
Yep, that was the trick. I remember running that command previously, but it slipped my mind. Thanks! –  kubiej21 Aug 17 '12 at 1:23

Check if your script is enabled in runlevels :

Method 1 :

ls /etc/rc?.d/

Method 2 :

apt-get install chkconfig
chkconfig --list
share|improve this answer
    
I think update-rc.d is the preferred method in Debian. –  Shane Madden Aug 17 '12 at 1:03
    
I Shane, and I can think of at least 2 others methods too. Would you please edit the post and provide hints about using update-rc.d ? –  coincoin Aug 17 '12 at 10:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.