mico/rc.mico

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
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@5 1 #!@l_prefix@/bin/openpkg rc
michael@5 2 ##
michael@5 3 ## rc.mico -- Run-Commands
michael@5 4 ##
michael@5 5
michael@5 6 %config
michael@5 7 mico_enable="$openpkg_rc_def"
michael@5 8 mico_micod="no"
michael@5 9 mico_nsd="no"
michael@5 10 mico_ip_micod="127.0.0.1"
michael@5 11 mico_ip_nsd="127.0.0.1"
michael@5 12 mico_micod_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_micod}:8912"
michael@5 13 mico_nsd_args="-ORBGIOPVersion 1.2 -ORBIIOPVersion 1.2 -ORBIIOPAddr inet:${mico_ip_nsd}:8914"
michael@5 14
michael@5 15 %common
michael@5 16 mico_micod_pidfile="@l_prefix@/var/mico/micod.pid"
michael@5 17 mico_nsd_pidfile="@l_prefix@/var/mico/nsd.pid"
michael@5 18 mico_signal () {
michael@5 19 local rc_micod=0
michael@5 20 local rc_nsd=0
michael@5 21 if rcVarIsYes mico_micod; then
michael@5 22 [ -f $mico_micod_pidfile ] \
michael@5 23 && kill -$1 `cat $mico_micod_pidfile`
michael@5 24 rc_micod=$?
michael@5 25 fi
michael@5 26 if rcVarIsYes mico_nsd; then
michael@5 27 [ -f $mico_nsd_pidfile ] \
michael@5 28 && kill -$1 `cat $mico_nsd_pidfile`
michael@5 29 rc_nsd=$?
michael@5 30 fi
michael@5 31 [ $rc_micod -eq 0 -a $rc_nsd -eq 0 ]
michael@5 32 }
michael@5 33
michael@5 34 %status -u @l_rusr@ -o
michael@5 35 mico_usable="unknown"
michael@5 36 mico_active="no"
michael@5 37 rcService mico enable yes && \
michael@5 38 ( rcVarIsYes mico_micod || rcVarIsYes mico_nsd ) && \
michael@5 39 mico_signal 0 && mico_active="yes"
michael@5 40 echo "mico_enable=\"$mico_enable\""
michael@5 41 echo "mico_usable=\"$mico_usable\""
michael@5 42 echo "mico_active=\"$mico_active\""
michael@5 43
michael@5 44 %start -u @l_rusr@
michael@5 45 rcService mico enable yes || exit 0
michael@5 46 rcService mico active yes && exit 0
michael@5 47 # run the object adapter daemon for dynamic object activation
michael@5 48 if rcVarIsYes mico_micod; then
michael@5 49 @l_prefix@/bin/micod ${mico_micod_args} &
michael@5 50 echo $! >$mico_micod_pidfile
michael@5 51 fi
michael@5 52 # run the name service daemon for flexible object indexing
michael@5 53 if rcVarIsYes mico_nsd; then
michael@5 54 @l_prefix@/bin/nsd ${mico_nsd_args} &
michael@5 55 echo $! >$mico_nsd_pidfile
michael@5 56 fi
michael@5 57
michael@5 58 %stop -u @l_rusr@
michael@5 59 rcService mico enable yes || exit 0
michael@5 60 rcService mico active no && exit 0
michael@5 61 mico_signal TERM
michael@5 62 rm -f $mico_micod_pidfile 2>/dev/null || true
michael@5 63 rm -f $mico_nsd_pidfile 2>/dev/null || true
michael@5 64
michael@5 65 %restart -u @l_rusr@
michael@5 66 rcService mico enable yes || exit 0
michael@5 67 rcService mico active no && exit 0
michael@5 68 rc mico stop
michael@5 69 sleep 2
michael@5 70 rc mico start
michael@5 71

mercurial