asterisk/rc.asterisk

Sat, 03 Oct 2009 16:18:52 +0200

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Oct 2009 16:18:52 +0200
changeset 220
a6cd892638c1
child 310
73d852a30c9a
permissions
-rw-r--r--

Update version, adjust corresponding buildconf, and correct logic.
1: Make minor corrections and improvements to scripts patch logic.
2: Upgrade to most recent stable release version 3.0.2.
3: Force selection of a single db backend, as multiple ones never
were supported (changing 'with_db<end>' identifiers accordingly.)
4: Unfortunately add gawk requirement although only partly needed.
5: Add openssl::with_threads requirement to solve strange and hard
to debug problems on Solaris leading to connection failures:

'host-dir JobId 0: Error: openssl.c:86 Connect failure: ERR=error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number'

and

'host-dir JobId 40: Fatal error: TLS negotiation failed with FD at "back1.host.com:9102"'

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

mercurial