#!/bin/bash
### BEGIN INIT INFO
# Provides: svnserve
# Required-Start: networking $local_fs
# Required-Stop:
# Default-Start: 3
# Default-Stop: 2 6
# Short-Description: Serveur SVN
# Description: Lancement su serveur SVN
### END INIT INFO
do_start()
{ echo 'Starting svnserve' start-stop-daemon --pidfile $PIDFILE --start --quiet --exec $DAEMON -- $OPTIONS
ret=$?
ZZZ=$(ps -ef | grep $DAEMON'.*'$CONF | grep -v grep)
set -- $ZZZ PID=$2
echo $PID>$PIDFILE
return $ret }
do_stop()
{ echo 'Stopping svnserve' start-stop-daemon --pidfile "$PIDFILE" --stop --oknodo
ret=$?
if [ -f "$PIDFILE" ]
then
rm -f $PIDFILE
fi
return $ret
}
# ==================================================
PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/bin/svnserve
CONF=/etc/svn/svnserve.conf
PIDFILE=/run/svnserve.pid
ROOT=/RAIDHOME/SUBV OPTIONS=' -d --config-file='$CONF' --root='$ROOT
. /lib/lsb/init-functions
# set -x
case "$1" in
start) do_start
ret=$?
;;
stop) do_stop
ret=$?
;;
restart) do_stop
ret=$?
if [ $ret -eq 0 ]
then
do_start
ret=$?
else
echo 'Can"t stop --> abort'
fi
;;
*) echo 'Action inconnue ('$1')'
ret=1
;;
esac
exit $ret
Note 2024 : ce script est toujours en service.