shoprex-icon-big

Shoprex

Developer site for the Wordpress Plugin Shoprex

Automatically load the Linux Subversion (svnserve) daemon at boot time


That the Subversion server on Linux is also loaded with a restart, you have to write your own script:

#!/bin/sh
#
### BEGIN INIT INFO
# Provides:          subversion
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start/Stop subversion daemon
# Description:       Enable service provided by daemon.
### END INIT INFO

test -f /usr/bin/svnserve || exit 0

OPTIONS="-d -T -r /path/to/repos"

case "$1" in
 start)
  echo -n "Starting subversion daemon:"
  echo -n " svnserve"
  start-stop-daemon --start --quiet --oknodo --chuid svn:subversion --exec /usr/bin/svnserve -- $OPTIONS
  echo "."
  ;;

 stop)
  echo -n "Stopping subversion daemon:"
  echo -n " svnserve"
  start-stop-daemon --stop --quiet --oknodo --exec /usr/bin/svnserve
  echo "."
  ;;

 reload)
  $0 restart
  ;;

 force-reload)
  $0 restart
  ;;

 restart)
  $0 stop
  $0 start
  ;;

 *)
  echo "Usage: /etc/init.d/subversion (start|stop|reload|restart)"
  exit 1
  ;;

esac
exit 0

The path “/path/to/repos” tweak accordingly.. Set the correct user and group by “–chuid svn:subversion” which have full access rights to the path.

Save the file as “subversion” in “/etc/init.d/” and adjust with

# chmod 0755 /etc/init.d/subversion

the rights.

To insert this script in the boot process you need following command:

# update-rc.d subversion defaults

After that it’s also possible to control the subversion deamon by hand

# service subversion start

# service subversion restart

# service subversion stop


Back

Leave a Reply

Your email address will not be published. Required fields are marked *

*
*
*