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