reference from : http://eightpence.com/a-subversion-initd-script-for-ubuntu-linux/

save following script as /etc/init.d/svnserve

 
#!/bin/sh -e
#
# svnserve - brings up the svn server so anonymous users
# can access svn
#

# Get LSB functions
. /lib/lsb/init-functions
. /etc/default/rcS

SVNSERVE=/usr/bin/svnserve
SVN_USER=subversion
SVN_GROUP=subversion
SVN_REPO_PATH=/home/$SVN_USER/

# Check that the package is still installed
[ -x $SVNSERVE ] || exit 0;

case "$1" in
start)
log_begin_msg "Starting svnserve..."
umask 002
if start-stop-daemon --start
--chuid $SVN_USER:$SVN_GROUP
--exec $SVNSERVE
-- -d -r $SVN_REPO_PATH; then
log_end_msg 0
else
log_end_msg $?
fi
;;

stop)
log_begin_msg "Stopping svnserve..."
if start-stop-daemon --stop --exec $SVNSERVE; then
log_end_msg 0
else
log_end_msg $?
fi
;;

restart|force-reload)
"$0" stop && "$0" start
;;

*)
echo "Usage: /etc/init.d/svnserve {start|stop|restart|force-reload}"
exit 1
;;
esac

exit 0

you can get it here as well

after you save the script, you need to change its permission like others
for me, ubuntu 8.10, but mostly 755 : chmod 755 /etc/init.d/svnserve

and then,

update-rc.d svnserve defaults

this command line adds above script(/etc/init.d/svnserve) initial scripts directories on /etc/rc#.d/


+ Recent posts