On 06/04/2021 22:34, Roger Lynn wrote:
I've written a new version of the script for Bullseye, based on Yubao Liu's
version and the template in init-d-script(5). Attached should be the
/etc/init.d/svnserve script and /etc/defaults/svnserve file. I am not an
expert on scripting, but it seems to work. It still needs Yubao Liu's
logrotate file.

And... that version didn't handle restarts properly. Here is a another attempt...

Regards,

Roger
#!/usr/bin/env /lib/init/init-d-script
### BEGIN INIT INFO
# Provides:          svnserve
# Required-Start:    $syslog $remote_fs $local_fs $network
# Required-Stop:     $syslog $remote_fs $local_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: SVN server daemon service
# Description:       Debian init script to start the daemon
#                    serving Subversion repositories.
### END INIT INFO


DAEMON=/usr/bin/svnserve
LOG_FILE=/var/log/svnserve.log

START_ARGS="-c svn:svn"


do_start_prepare()
{
        DAEMON_ARGS="-d -T -r $REPOS_DIR --config-file=$CONFIG_FILE 
--log-file=$LOG_FILE $SVNSERVE_OPTIONS"

        if [ ! -f "$LOG_FILE" ]; then
                touch $LOG_FILE
                chown svn:adm $LOG_FILE
                chmod 640 $LOG_FILE
        fi
}


do_restart_prepare()
{
        do_start_prepare
}

Reply via email to