asterisk/rc.asterisk

Sat, 21 May 2011 22:05:42 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 21 May 2011 22:05:42 +0200
changeset 340
870131689a5c
parent 310
73d852a30c9a
child 347
10bd406e1c51
permissions
-rw-r--r--

Correct diverse buildconf of upstream release and reconcile packaging somewhat.
These changes stem from the obvious changes in the latest vendor release, but
from discussions with trolls Daniel and Oswald as well regarding build config.

This commital follows conclusion of buildconf adjustments to allow the new
vendor version to build on Linux AMD64, but is incomplete as many packaging
comments show. The next series of changes focus on Solaris IA32 and reduction
of buildconf adjustments testing old problems comprehensively in anticipation
of discussion at the upcoming Nokia Contributor Summit in Berlin.

     1 #!@l_prefix@/bin/openpkg rc
     2 ##
     3 ##  rc.asterisk -- Run-Commands
     4 ##
     6 %config
     7     asterisk_enable="$openpkg_rc_def"
     8     asterisk_nice="-5"
     9     asterisk_flags=""
    10     asterisk_log_prolog="true"
    11     asterisk_log_epilog="true"
    12     asterisk_log_numfiles="10"
    13     asterisk_log_minsize="1M"
    14     asterisk_log_complevel="9"
    16 %status -u @l_susr@ -o
    17     asterisk_usable="unknown"
    18     asterisk_active="no"
    19     rcService asterisk enable yes && \
    20         @l_prefix@/sbin/asterisk -rx "show version" >/dev/null 2>&1 && \
    21         asterisk_active="yes"
    22     echo "asterisk_enable=\"$asterisk_enable\""
    23     echo "asterisk_usable=\"$asterisk_usable\""
    24     echo "asterisk_active=\"$asterisk_active\""
    26 %start -u @l_susr@
    27     rcService asterisk enable yes || exit 0
    28     rcService asterisk active yes && exit 0
    29     nice -n $asterisk_nice @l_prefix@/sbin/asterisk ${asterisk_flags}
    31 %stop -u @l_susr@
    32     rcService asterisk enable yes || exit 0
    33     rcService asterisk active no  && exit 0
    34     ( @l_prefix@/sbin/asterisk -rx "core stop gracefully" &
    35       sleep 2
    36       @l_prefix@/sbin/asterisk -rx "core stop now" &
    37     ) >/dev/null 2>&1 || true
    39 %restart -u @l_susr@
    40     rcService asterisk enable yes || exit 0
    41     rcService asterisk active no  && exit 0
    42     @l_prefix@/sbin/asterisk -rx "core restart now"
    44 %reload -u @l_susr@
    45     rcService asterisk enable yes || exit 0
    46     rcService asterisk active no  && exit 0
    47     @l_prefix@/sbin/asterisk -rx "reload"
    49 %daily -u @l_susr@
    50     rcService asterisk enable yes || exit 0
    51     shtool rotate -f \
    52         -n ${asterisk_log_numfiles} -s ${asterisk_log_minsize} -d \
    53         -z ${asterisk_log_complevel} -m 664 -o @l_rusr@ -g @l_rgrp@ \
    54         -P "${asterisk_log_prolog}" \
    55         -E "${asterisk_log_epilog}; rc asterisk reload" \
    56         @l_prefix@/var/asterisk/log/asterisk.log

mercurial