# apt update

# apt install -y subversion

 

svnserve 파일 준비하여 /etc/init.d/ 에 복사

svnserve 파일 내용

——————————————————————————————————————————

#! /bin/sh

### BEGIN INIT INFO

# Provides: svnserve

# Required-Start: $local_fs $syslog $remote_fs

# Required-Stop: $local_fs $syslog $remote_fs

# Default-Start: 2 3 4 5

# Default-Stop: 0 1 6

# Short-Description: Start svnserve

### END INIT INFO

 

PATH=/sbin:/usr/sbin:/bin:/usr/bin

DESC="svnserve"

NAME=svnserve

DAEMON=/usr/bin/$NAME

DAEMON_ARGS="-d -r /var/opt/svn"

PIDFILE=/var/run/$NAME.pid

SCRIPTNAME=/etc/init.d/$NAME

 

[ -x "$DAEMON" ] || exit 0

 

[ -r /etc/default/$NAME ] && . /etc/default/$NAME

 

. /lib/init/vars.sh

. /lib/lsb/init-functions

 

do_start() {

    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \

        || return 1

 

    start-stop-daemon --start --quiet --pidfile $PIDFILE --exec $DAEMON -- $DAEMON_ARGS \

        || return 2

}

 

do_stop() {

    start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 --pidfile $PIDFILE --name $NAME

    RETVAL="$?"

    [ "$RETVAL" = 2 ] && return 2

    start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON

    [ "$?" = 2 ] && return 2

    rm -f $PIDFILE

    return "$RETVAL"

}

 

case "$1" in

    start)

        [ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESC" "$NAME"

        do_start

        case "$?" in

            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;

            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;

        esac

        ;;

 

    stop)

        [ "$VERBOSE" != no ] && log_daemon_msg "Stopping $DESC" "$NAME"

        do_stop

        case "$?" in

            0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;

            2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;

            esac

            ;;

 

    restart|force-reload)

        log_daemon_msg "Restarting $DESC" "$NAME"

        do_stop

        case "$?" in

        0|1)

            do_start

            case "$?" in

                0) log_end_msg 0 ;;

                1) log_end_msg 1 ;; # Old process is still running

                *) log_end_msg 1 ;; # Failed to start

            esac

            ;;

        *)

            # Failed to stop

            log_end_msg 1

            ;;

        esac

        ;;

*)

    echo "Usage: $SCRIPTNAME {start|stop|restart|force-reload}" >&2

    exit 3

    ;;

esac

 

exit 0

———————————————————————————————————

 

# chmod +x /etc/init.d/svnserve

# update-rc.d svnserve defaults

# svnadmin create --fs-type fsfs /var/opt/svn

# echo “[유져아이디] = [비밀번호]” >> /var/opt/svn/conf/passwd

# mv /var/opt/svn/conf/svnserve.conf /var/opt/svn/conf/svnserve.conf.bak

# echo "[general]" >> /var/opt/svn/conf/svnserve.conf

# echo "anon-access = read" >> /var/opt/svn/conf/svnserve.conf

# echo "auth-access = write" >> /var/opt/svn/conf/svnserve.conf

# echo "password-db = passwd" >> /var/opt/svn/conf/svnserve.conf

# echo "realm = Board Repository" >> /var/opt/svn/conf/svnserve.conf

# echo "[sasl]" >> /var/opt/svn/conf/svnserve.conf

# systemctl enable svnserve

'리눅스' 카테고리의 다른 글

[Linux 공통] Window 듀얼부팅 시간설정  (0) 2023.09.10
[Ubuntu 22.04] 한글폰트 설치  (0) 2023.06.02
[Ubuntu 22.04] Tomcat9 설치  (0) 2023.06.02
[Ubuntu 22.04] Nginx 서버 설치  (0) 2023.06.02
[Ubuntu 22.04] MariaDB 설치  (0) 2023.06.02
Posted by jtfafa
,