opensips/rc.opensips

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
parent 376
8f552d1cd671
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

michael@376 1 #!@l_prefix@/bin/openpkg rc
michael@376 2 ##
michael@376 3 ## rc.opensips -- Run-Commands
michael@376 4 ##
michael@376 5
michael@376 6 %config
michael@376 7 opensips_enable="$openpkg_rc_def"
michael@376 8 opensips_rtpproxy="yes"
michael@377 9 opensips_rtpproxy_addr="127.0.0.1:12345"
michael@376 10 opensips_log_prolog="true"
michael@376 11 opensips_log_epilog="true"
michael@376 12 opensips_log_numfiles="10"
michael@376 13 opensips_log_minsize="1M"
michael@376 14 opensips_log_complevel="9"
michael@376 15
michael@376 16 %common
michael@376 17 opensips_cfgfile="@l_prefix@/etc/opensips/opensips.cfg"
michael@376 18 opensips_pidfile="@l_prefix@/var/opensips/opensips.pid"
michael@376 19 opensips_rtpproxy_pidfile="@l_prefix@/var/opensips/opensips_rtpproxy.pid"
michael@376 20 opensips_rtpproxy_socket="@l_prefix@/var/opensips/opensips_rtpproxy.sock"
michael@377 21 opensips_signal () {
michael@377 22 [ -f $opensips_pidfile ] && kill -$1 `cat $opensips_pidfile`
michael@377 23 }
michael@376 24 opensips_rtpproxy_signal () {
michael@376 25 [ -f $opensips_rtpproxy_pidfile ] && kill -$1 `cat $opensips_rtpproxy_pidfile`
michael@376 26 }
michael@376 27
michael@376 28 %status -u @l_susr@ -o
michael@376 29 opensips_usable="no"
michael@376 30 opensips_active="no"
michael@376 31 if @l_prefix@/sbin/opensips -c >/dev/null 2>&1; then
michael@376 32 opensips_usable="yes"
michael@376 33 fi
michael@377 34 if rcService opensips enable yes && opensips_signal 0; then
michael@376 35 opensips_active="yes"
michael@376 36 fi
michael@376 37 echo "opensips_enable=\"$opensips_enable\""
michael@376 38 echo "opensips_usable=\"$opensips_usable\""
michael@376 39 echo "opensips_active=\"$opensips_active\""
michael@376 40
michael@376 41 %start -u @l_susr@
michael@376 42 rcService opensips enable yes || exit 0
michael@376 43 rcService opensips active yes && exit 0
michael@376 44 if rcVarIsYes opensips_rtpproxy; then
michael@377 45 cmd="@l_prefix@/sbin/rtpproxy" \
michael@377 46 cmd="$cmd -u @l_rusr@"
michael@377 47 cmd="$cmd -l $opensips_rtpproxy_addr"
michael@376 48 cmd="$cmd -s unix:$opensips_rtpproxy_socket"
michael@376 49 cmd="$cmd -p $opensips_rtpproxy_pidfile"
michael@376 50 su @l_rusr@ -c "$cmd"
michael@376 51 fi
michael@377 52 @l_prefix@/sbin/opensipsctl start
michael@376 53
michael@376 54 %stop -u @l_susr@
michael@376 55 rcService opensips enable yes || exit 0
michael@376 56 rcService opensips active no && exit 0
michael@376 57 @l_prefix@/sbin/opensipsctl stop
michael@377 58 rm -f $opensips_pidfile 2>/dev/null || true
michael@376 59 if rcVarIsYes opensips_rtpproxy; then
michael@376 60 opensips_rtpproxy_signal TERM
michael@376 61 fi
michael@376 62 sleep 2
michael@376 63
michael@376 64 %restart -u @l_susr@
michael@376 65 rcService opensips enable yes || exit 0
michael@376 66 rcService opensips active no && exit 0
michael@376 67 rc opensips stop start
michael@376 68
michael@376 69 %daily -u @l_susr@
michael@376 70 rcService opensips enable yes || exit 0
michael@376 71 shtool rotate -f \
michael@376 72 -n ${opensips_log_numfiles} -s ${opensips_log_minsize} -d \
michael@376 73 -z ${opensips_log_complevel} -m 644 -o @l_rusr@ -g @l_rgrp@ \
michael@376 74 -P "${opensips_log_prolog}" \
michael@376 75 -E "${opensips_log_epilog}; rc opensips reload" \
michael@376 76 @l_prefix@/var/opensips/opensips.log
michael@376 77

mercurial