| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879 |
- #!@l_prefix@/bin/openpkg rc
- ##
- ## rc.git -- Run-Commands
- ##
- %config
- git_enable="$openpkg_rc_def"
- git_daemon="no"
- git_daemon_flags=""
- git_daemon_host="127.0.0.1"
- git_daemon_port="9418"
- git_daemon_user="@l_rusr@"
- git_daemon_group="@l_rgrp@"
- git_daemon_basedir="@l_prefix@/var/git/db"
- git_log_prolog="true"
- git_log_epilog="true"
- git_log_numfiles="10"
- git_log_minsize="1M"
- git_log_complevel="9"
- %common
- git_daemon_pidfile="@l_prefix@/var/git/run/git-daemon.pid"
- git_daemon_logfile="@l_prefix@/var/git/run/git-daemon.log"
- git_daemon_signal () {
- [ -f $git_daemon_pidfile ] && kill -$1 `cat $git_daemon_pidfile`
- }
- %status -u @l_susr@ -o
- git_usable="unknown"
- git_active="no"
- rcService git enable yes && \
- rcVarIsYes git_daemon && \
- git_daemon_signal 0 && \
- git_active="yes"
- echo "git_enable=\"$git_enable\""
- echo "git_usable=\"$git_usable\""
- echo "git_active=\"$git_active\""
- %start -u @l_susr@
- rcService git enable yes || exit 0
- rcService git active yes && exit 0
- if rcVarIsYes git_daemon; then
- ( nohup @l_prefix@/bin/git daemon \
- --reuseaddr \
- --listen="$git_daemon_host" \
- --port="$git_daemon_port" \
- --user="$git_daemon_user" \
- --group="$git_daemon_group" \
- --base-path="$git_daemon_basedir" \
- $git_daemon_flags \
- </dev/null >>$git_daemon_logfile 2>&1 &
- echo $! >$git_daemon_pidfile
- ) </dev/null >/dev/null 2>&1
- fi
- %stop -u @l_susr@
- rcService git enable yes || exit 0
- rcService git active no && exit 0
- if rcVarIsYes git_daemon; then
- git_daemon_signal TERM
- sleep 1
- rm -f $git_daemon_pidfile 2>/dev/null || true
- fi
- %restart -u @l_susr@
- rcService git enable yes || exit 0
- rcService git active no && exit 0
- rc git stop start
- %daily -u @l_susr@
- rcService git enable yes || exit 0
- shtool rotate -f \
- -n ${git_log_numfiles} -s ${git_log_minsize} -d \
- -z ${git_log_complevel} -m 644 -o @l_rusr@ -g @l_rusr@ \
- -P "${git_log_prolog}" \
- -E "${git_log_epilog}" \
- $git_daemon_logfile
|