gmediaserver/rc.gmediaserver

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 89
784543bb550b
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@75 1 #!@l_prefix@/bin/openpkg rc
michael@75 2 ##
michael@75 3 ## rc.gmediaserver -- runcommands
michael@75 4 ##
michael@75 5
michael@75 6 %config
michael@75 7 gmediaserver_enable="$openpkg_rc_def"
michael@75 8 gmediaserver_log_prolog="true"
michael@75 9 gmediaserver_log_epilog="true"
michael@75 10 gmediaserver_log_numfiles="10"
michael@75 11 gmediaserver_log_minsize="1M"
michael@75 12 gmediaserver_log_complevel="9"
michael@75 13 gmediaserver_name="GMediaServer"
michael@75 14 gmediaserver_fschar="ISO-8859-1"
michael@75 15 gmediaserver_devchar="ISO-8859-1"
michael@75 16 gmediaserver_logchar="ISO-8859-1"
michael@75 17 gmediaserver_profile="generic"
michael@89 18 gmediaserver_ftypes="ogg,mp3,wma,wav,pls,m3u,m4a,jpg,png,unknown"
michael@75 19 gmediaserver_expire="100"
michael@75 20 gmediaserver_iface="lo0"
michael@75 21 gmediaserver_port="49152"
michael@89 22 gmediaserver_dirs="@l_prefix@/share/gmediaserver"
michael@105 23 gmediaserver_cmdstart="echo 'route add -net 239.0.0.0 netmask 255.0.0.0 dev lo0'"
michael@105 24 gmediaserver_cmdstop="echo 'route del -net 239.0.0.0 netmask 255.0.0.0 dev lo0'"
michael@75 25
michael@75 26 %common
michael@75 27 gmediaserver_pidfile="@l_prefix@/var/gmediaserver/run/gmediaserver.pid"
michael@75 28 gmediaserver_logfile="@l_prefix@/var/gmediaserver/log/gmediaserver.log"
michael@75 29 gmediaserver_signal () {
michael@75 30 [ -f $gmediaserver_pidfile ] && kill -$1 `cat $gmediaserver_pidfile`
michael@75 31 }
michael@75 32
michael@75 33 %status -u @l_susr@ -o
michael@75 34 gmediaserver_usable="no"
michael@75 35 gmediaserver_active="no"
michael@75 36 rcService gmediaserver enable yes && \
michael@75 37 gmediaserver_usable="yes"
michael@75 38 rcService gmediaserver enable yes && \
michael@75 39 gmediaserver_signal 0 && gmediaserver_active="yes"
michael@75 40 echo "gmediaserver_enable=\"$gmediaserver_enable\""
michael@75 41 echo "gmediaserver_usable=\"$gmediaserver_usable\""
michael@75 42 echo "gmediaserver_active=\"$gmediaserver_active\""
michael@75 43
michael@75 44 %start -u @l_susr@
michael@75 45 rcService gmediaserver enable yes || exit 0
michael@75 46 rcService gmediaserver active yes && exit 0
michael@81 47 eval $gmediaserver_cmdstart
michael@75 48 @l_prefix@/bin/gmediaserver \
michael@75 49 --friendly-name=$gmediaserver_name \
michael@75 50 --fs-charset=$gmediaserver_fschar \
michael@75 51 --device-charset=$gmediaserver_devchar \
michael@75 52 --log-charset=$gmediaserver_logchar \
michael@75 53 --profile=$gmediaserver_profile \
michael@75 54 --file-types=$gmediaserver_ftypes \
michael@75 55 --expire-time=$gmediaserver_expire \
michael@75 56 --interface=$gmediaserver_iface \
michael@75 57 --port=$gmediaserver_port \
michael@75 58 --pid-file=$gmediaserver_pidfile \
michael@75 59 --output=$gmediaserver_logfile \
michael@75 60 --background \
michael@75 61 --timestamp \
michael@75 62 $gmediaserver_dirs
michael@75 63
michael@75 64 %stop -u @l_susr@
michael@75 65 rcService gmediaserver enable yes || exit 0
michael@75 66 rcService gmediaserver active no && exit 0
michael@75 67 gmediaserver_signal TERM
michael@81 68 eval $gmediaserver_cmdstop
michael@75 69
michael@75 70 %restart -u @l_susr@
michael@75 71 rcService gmediaserver enable yes || exit 0
michael@75 72 rcService gmediaserver active no && exit 0
michael@75 73 rc gmediaserver stop
michael@75 74 sleep 2
michael@75 75 rc gmediaserver start
michael@75 76
michael@75 77 %reload -u @l_susr@
michael@75 78 rcService gmediaserver enable yes || exit 0
michael@75 79 rcService gmediaserver active no && exit 0
michael@75 80 gmediaserver_signal USR1
michael@75 81
michael@75 82 %daily -u @l_susr@
michael@75 83 rcService gmediaserver enable yes || exit 0
michael@75 84 shtool rotate -f \
michael@75 85 -n ${gmediaserver_log_numfiles} -s ${gmediaserver_log_minsize} -d \
michael@75 86 -z ${gmediaserver_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \
michael@75 87 -P "${gmediaserver_log_prolog}" \
michael@75 88 -E "${gmediaserver_log_epilog}; rc gmediaserver restart" \
michael@75 89 @l_prefix@/var/gmediaserver/log/gmediaserver.log \
michael@75 90 @l_prefix@/var/gmediaserver/log/arpsnmp.log

mercurial