I have a Raspberry Pi Model B with Raspbian. I installed the SVN server and tested it with
svnserve -d -r /home/pi/external_hdd/svn_root
It works, it accepts connections and makes users checkout and commit their work.
Now, I don't want to manually start the server every time I power off and then power back on my Raspberry Pi, so I would like to make svnserve
start at boot.
I went to the console and typed:
cd /etc/init.d
sudo touch svnserve
sudo nano svnserve
------------------ START of the Nano window ------------------
#!/bin/bash
### BEGIN INIT INFO
# Provides: svnserve
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# X-Interactive: true
# Short-Description: Start/stop svnserve
### END INIT INFO
svnserve -d -r /home/pi/external_hdd/svn_root
------------------- END of the Nano window -------------------
^O # Pressed CTRL-O to save the file
Return # Confirmed to save into the svnserve file
^X # Exited nano
chmod u+x /etc/init.d/svnserve
So this way I created my startup script and marked it as executable.
Then I used the update-rc.d
to add the script to startup:
sudo update-rc.d svnserve defaults
The output is:
update-rc.d: using dependency based boot sequencing
insserv: warning: script 'mathkernel' missing LSB tags and overrides
This is the first time I try to add a script to startup; what is this error?
I've seen some forum where users had the same problem, and they said that the first part (the init part) of the script was missing, and that adding it would have solved the issue. The fact is that I have it, and it still doesn't work.
Is there something I'm missing?
#!/bin/bash
) is the first in the script. E.g. no empty lines above it?mathkernel
file under/etc/init.d
. In fact it doesn't have the init section at the beginning of the file. I did the fix described in the answer and solved it :)