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@47 | 1 | #!@l_prefix@/bin/openpkg rc |
michael@47 | 2 | ## |
michael@47 | 3 | ## rc.freeradius -- Run-Commands |
michael@47 | 4 | ## |
michael@47 | 5 | |
michael@47 | 6 | %config |
michael@47 | 7 | freeradius_enable="$openpkg_rc_def" |
michael@47 | 8 | freeradius_flags="" |
michael@47 | 9 | freeradius_log_prolog="true" |
michael@47 | 10 | freeradius_log_epilog="true" |
michael@47 | 11 | freeradius_log_numfiles="10" |
michael@47 | 12 | freeradius_log_minsize="1M" |
michael@47 | 13 | freeradius_log_complevel="9" |
michael@47 | 14 | |
michael@47 | 15 | %common |
michael@47 | 16 | freeradius_logfile="@l_prefix@/var/freeradius/radius.log" |
michael@47 | 17 | freeradius_pidfile="@l_prefix@/var/freeradius/radiusd.pid" |
michael@47 | 18 | freeradius_signal () { |
michael@47 | 19 | [ -f $freeradius_pidfile ] && kill -$1 `cat $freeradius_pidfile` |
michael@47 | 20 | } |
michael@47 | 21 | |
michael@47 | 22 | %status -u @l_susr@ -o |
michael@47 | 23 | freeradius_usable="no" |
michael@47 | 24 | freeradius_active="no" |
michael@47 | 25 | rcService freeradius enable yes && \ |
michael@47 | 26 | freeradius_signal 0 && freeradius_active="yes" |
michael@47 | 27 | echo "freeradius_enable=\"$freeradius_enable\"" |
michael@47 | 28 | echo "freeradius_usable=\"$freeradius_usable\"" |
michael@47 | 29 | echo "freeradius_active=\"$freeradius_active\"" |
michael@47 | 30 | |
michael@47 | 31 | %start -u @l_susr@ |
michael@47 | 32 | rcService freeradius enable yes || exit 0 |
michael@47 | 33 | rcService freeradius active yes && exit 0 |
michael@47 | 34 | @l_prefix@/sbin/radiusd ${freeradius_flags} |
michael@47 | 35 | |
michael@47 | 36 | %stop -u @l_susr@ |
michael@47 | 37 | rcService freeradius enable yes || exit 0 |
michael@47 | 38 | rcService freeradius active no && exit 0 |
michael@47 | 39 | freeradius_signal TERM |
michael@47 | 40 | sleep 2 |
michael@47 | 41 | rm -f ${freeradius_pidfile} >/dev/null 2>&1 || true |
michael@47 | 42 | |
michael@47 | 43 | %restart -u @l_susr@ |
michael@47 | 44 | rcService freeradius enable yes || exit 0 |
michael@47 | 45 | rcService freeradius active no && exit 0 |
michael@47 | 46 | rc freeradius stop start |
michael@47 | 47 | |
michael@47 | 48 | %daily -u @l_susr@ |
michael@47 | 49 | rcService freeradius enable yes || exit 0 |
michael@47 | 50 | shtool rotate -f \ |
michael@47 | 51 | -n ${freeradius_log_numfiles} -s ${freeradius_log_minsize} -d \ |
michael@47 | 52 | -z ${freeradius_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \ |
michael@47 | 53 | -P "${freeradius_log_prolog}" \ |
michael@47 | 54 | -E "${freeradius_log_epilog} && rc freeradius reload" \ |
michael@47 | 55 | ${freeradius_logfile} |
michael@47 | 56 |