subversion/rc.subversion

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.subversion -- Run-Commands
     4 ##
     6 %config
     7     subversion_enable="$openpkg_rc_def"
     8     subversion_env="no"
     9     subversion_daemon="no"
    10     subversion_daemon_user="@l_rusr@"
    11     subversion_daemon_host="127.0.0.1"
    12     subversion_daemon_port="3690"
    13     subversion_daemon_root="@l_prefix@/var/subversion/default"
    14     subversion_daemon_pidfile="@l_prefix@/var/subversion/subversion.pid"
    15     subversion_daemon_logfile="@l_prefix@/var/subversion/subversion.log"
    16     subversion_daemon_log_prolog="true"
    17     subversion_daemon_log_epilog="true"
    18     subversion_daemon_log_numfiles="10"
    19     subversion_daemon_log_minsize="1M"
    20     subversion_daemon_log_complevel="9"
    22 %common
    23     subversion_signal () {
    24         [ -f $subversion_daemon_pidfile ] \
    25         && kill -$1 `cat $subversion_daemon_pidfile`
    26     }
    28 %status -u @l_susr@ -o
    29     subversion_usable="unknown"
    30     subversion_active="no"
    31     rcService subversion enable yes && \
    32         subversion_signal 0 && subversion_active="yes"
    33     echo "subversion_enable=\"$subversion_enable\""
    34     echo "subversion_usable=\"$subversion_usable\""
    35     echo "subversion_active=\"$subversion_active\""
    37 %start -u @l_susr@
    38     rcService subversion enable yes || exit 0
    39     rcService subversion active yes && exit 0
    40     if rcVarIsYes subversion_daemon; then
    41         su - $subversion_daemon_user -c \
    42         "@l_prefix@/bin/svnserve --daemon \
    43               --listen-host $subversion_daemon_host \
    44               --listen-port $subversion_daemon_port \
    45               --root $subversion_daemon_root \
    46               --pid-file $subversion_daemon_pidfile"
    47     fi
    49 %stop -u @l_susr@
    50     rcService subversion enable yes || exit 0
    51     rcService subversion active no  && exit 0
    52     if rcVarIsYes subversion_daemon; then
    53         subversion_signal TERM
    54         sleep 2
    55         rm -f $subversion_daemon_pidfile 2>/dev/null || true
    56     fi
    58 %restart -u @l_susr@
    59     rcService subversion enable yes || exit 0
    60     rcService subversion active no  && exit 0
    61     rc subversion stop start
    63 %daily -u @l_susr@
    64     rcService subversion enable yes || exit 0
    65     shtool rotate -f \
    66         -n $subversion_daemon_log_numfiles -s $subversion_daemon_log_minsize -d \
    67         -z $subversion_daemon_log_complevel -m 664 -o @l_susr@ -g @l_sgrp@ \
    68         -P "$subversion_daemon_log_prolog" \
    69         -E "$subversion_daemon_log_epilog; rc subversion restart" \
    70         $subversion_daemon_logfile
    72 %env
    73     rcService subversion enable yes || exit 0
    74     if rcVarIsYes subversion_env; then
    75         if [ ".$BASH" != . ]; then
    76             shopt -s extglob progcomp
    77             . @l_prefix@/etc/subversion/bashrc
    78         fi
    79     fi

mercurial