Tons of bugfixes for the installer on Debian

* Still need to get pypo working with sysvinit
* Still need to fix this logger.cfg silliness with pypo and
  media_monitor
This commit is contained in:
Albert Santoni 2015-02-13 11:32:07 -05:00
parent d46f4a52eb
commit bbcd4fbe2e
9 changed files with 79 additions and 21 deletions

41
install
View File

@ -100,6 +100,11 @@ function checkCommandExists() {
set -e
}
function checkDistro() {
distro=$@
unameStr=`uname -a`
eval echo "${unameStr}" | grep --quiet "${distro}"
}
while :; do
case "$1" in
--help)
@ -246,6 +251,27 @@ echo "/ | \ || | \ | | | / Y \| \ "
echo "\____|__ /___||____|_ / |____| |___\____|__ /_______ / "
echo -e " \/ \/ \/ \/ \n"
# Check for the distribution without using lsb_release, which not all distros have installed by default
if checkDistro "wheezy"; then
dist="debian"
code="wheezy"
elif checkDistro "trusty"; then
dist="ubuntu"
code="trusty"
elif checkDistro "saucy"; then
dist="ubuntu"
code="saucy"
elif checkDistro "precise"; then
dist="ubuntu"
code="precise"
elif checkDistro "trusty"; then
dist="ubuntu"
code="trusty"
else
dist="unknown"
code="unknown"
fi
if [ "$ignore_dependencies" = "f" ]; then
loud "\n-----------------------------------------------------"
loud " * Installing External Dependencies * "
@ -253,13 +279,13 @@ if [ "$ignore_dependencies" = "f" ]; then
verbose "\n * Reading requirements-${dist,,}-${code,,}.apt..."
set +e
loudCmd "sudo apt-get update"
if [ -f ${SCRIPT_DIR}/installer/lib/requirements-${dist,,}-${code,,}.apt ]; then
loudCmd "DEBIAN_FRONTEND=noninteractive apt-get -y -m --force-yes install $(grep -vE '^\s*#' ${SCRIPT_DIR}/installer/lib/requirements-${dist,,}-${code,,}.apt | tr '\n' ' ')"
else
loudCmd "DEBIAN_FRONTEND=noninteractive apt-get -y -m --force-yes install $(grep -vE '^\s*#' ${SCRIPT_DIR}/installer/lib/requirements-ubuntu-trusty.apt | tr '\n' ' ')"
fi
set -e
else
checkCommandExists "apache2"
checkCommandExists "rabbitmqctl"
@ -399,19 +425,19 @@ chown -R ${web_user}:${web_user} /run/airtime
verbose "...Done"
verbose "\n * Installing log writer..."
loudCmd "python ${AIRTIMEROOT}/python_apps/std_err_override/setup.py install"
loudCmd "python ${AIRTIMEROOT}/python_apps/std_err_override/setup.py install --install-scripts=/usr/bin"
verbose "...Done"
verbose "\n * Installing API client..."
loudCmd "python ${AIRTIMEROOT}/python_apps/api_clients/setup.py install"
loudCmd "python ${AIRTIMEROOT}/python_apps/api_clients/setup.py install --install-scripts=/usr/bin"
verbose "...Done"
verbose "\n * Installing media-monitor..."
loudCmd "python ${AIRTIMEROOT}/python_apps/media-monitor/setup.py install"
loudCmd "python ${AIRTIMEROOT}/python_apps/media-monitor/setup.py install --install-scripts=/usr/bin"
verbose "...Done"
verbose "\n * Installing pypo..."
loudCmd "python ${AIRTIMEROOT}/python_apps/pypo/setup.py install"
loudCmd "python ${AIRTIMEROOT}/python_apps/pypo/setup.py install --install-scripts=/usr/bin"
verbose "...Done"
for i in /etc/init/airtime*.template; do
@ -420,7 +446,7 @@ for i in /etc/init/airtime*.template; do
mv $i ${i%.template}
done
loudCmd "initctl reload-configuration"
#loudCmd "initctl reload-configuration"
if [ ! -d /var/log/airtime ]; then
loud "\n-----------------------------------------------------"
@ -530,9 +556,6 @@ if [ "$ignore_dependencies" = "f" ]; then
loud " * Installing Locales * "
loud "-----------------------------------------------------"
dist=`lsb_release -is`
code=`lsb_release -cs`
set +e
verbose "\n * Generating locales"
for i in `ls /usr/share/airtime/locale | grep ".._.."`; do

View File

@ -52,6 +52,7 @@ coreutils
liquidsoap
silan
libopus0
sysvinit
sysvinit-utils

View File

@ -68,3 +68,5 @@ liquidsoap-plugin-vorbis
silan
libopus0
sysv-init
sysvinit-utils

View File

@ -67,3 +67,6 @@ liquidsoap-plugin-vorbis
silan
libopus0
sysv-init
sysvinit-utils

View File

@ -67,3 +67,5 @@ liquidsoap-plugin-vorbis
silan
libopus0
sysv-init
sysvinit-utils

18
python_apps/media-monitor/bin/airtime-media-monitor Executable file → Normal file
View File

@ -1,3 +1,17 @@
#!/bin/bash
#!/usr/bin/python
import logging
import locale
import time
import sys
import os
import mm2.mm2 as mm2
from std_err_override import LogWriter
locale.setlocale(locale.LC_ALL, '')
exec python -m media_monitor > /var/log/airtime/media-monitor/py-interpreter.log 2>&1
def run():
global_cfg = '/etc/airtime/airtime.conf'
logging_cfg = os.path.join(os.path.dirname(__file__), 'logging.cfg')
mm2.main( global_cfg, logging_cfg )
run()

View File

@ -9,12 +9,26 @@
# Short-Description: Manage airtime-media-monitor daemon
### END INIT INFO
USERID=WEB_USER
GROUPID=WEB_USER
NAME=Airtime\ Media\ Monitor
USERID=www-data
GROUPID=www-data
NAME=airtime-media-monitor
DAEMON=/usr/lib/airtime/media-monitor/airtime-media-monitor
PIDFILE=/var/run/airtime/airtime-media-monitor.pid
DAEMON=/usr/bin/$NAME
PIDFILE=/var/run/$NAME.pid
# Exit if the package is not installed
[ -x "$DAEMON" ] || exit 0
# Read configuration variable file if it is present
[ -r /etc/default/$NAME ] && . /etc/default/$NAME
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.2-14) to ensure that this file is present
# and status_of_proc is working.
. /lib/lsb/init-functions
start () {
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \
@ -48,8 +62,7 @@ case "${1:-''}" in
echo "Done."
;;
'status')
# status commands here
/usr/bin/airtime-check-system
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
;;
*) # no parameter specified
echo "Usage: $SELF start|stop|restart|status"

View File

@ -60,5 +60,5 @@ setup(name='airtime-media-monitor',
# Reload the initctl config so that the media-monitor service works
if data_files:
print "Reloading initctl configuration"
call(['initctl', 'reload-configuration'])
#call(['initctl', 'reload-configuration'])
print "Run \"sudo service airtime-media-monitor start\""

View File

@ -64,5 +64,5 @@ setup(name='airtime-playout',
# Reload the initctl config so that playout services works
if data_files:
print "Reloading initctl configuration"
call(['initctl', 'reload-configuration'])
#call(['initctl', 'reload-configuration'])
print "Run \"sudo service airtime-playout start\" and \"sudo service airtime-liquidsoap start\""