freeradius/rc.freeradius

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

mercurial