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:
parent
d46f4a52eb
commit
bbcd4fbe2e
41
install
41
install
|
@ -100,6 +100,11 @@ function checkCommandExists() {
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function checkDistro() {
|
||||||
|
distro=$@
|
||||||
|
unameStr=`uname -a`
|
||||||
|
eval echo "${unameStr}" | grep --quiet "${distro}"
|
||||||
|
}
|
||||||
while :; do
|
while :; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--help)
|
--help)
|
||||||
|
@ -246,6 +251,27 @@ echo "/ | \ || | \ | | | / Y \| \ "
|
||||||
echo "\____|__ /___||____|_ / |____| |___\____|__ /_______ / "
|
echo "\____|__ /___||____|_ / |____| |___\____|__ /_______ / "
|
||||||
echo -e " \/ \/ \/ \/ \n"
|
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
|
if [ "$ignore_dependencies" = "f" ]; then
|
||||||
loud "\n-----------------------------------------------------"
|
loud "\n-----------------------------------------------------"
|
||||||
loud " * Installing External Dependencies * "
|
loud " * Installing External Dependencies * "
|
||||||
|
@ -253,13 +279,13 @@ if [ "$ignore_dependencies" = "f" ]; then
|
||||||
|
|
||||||
verbose "\n * Reading requirements-${dist,,}-${code,,}.apt..."
|
verbose "\n * Reading requirements-${dist,,}-${code,,}.apt..."
|
||||||
set +e
|
set +e
|
||||||
|
loudCmd "sudo apt-get update"
|
||||||
if [ -f ${SCRIPT_DIR}/installer/lib/requirements-${dist,,}-${code,,}.apt ]; then
|
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' ' ')"
|
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
|
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' ' ')"
|
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
|
fi
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
else
|
else
|
||||||
checkCommandExists "apache2"
|
checkCommandExists "apache2"
|
||||||
checkCommandExists "rabbitmqctl"
|
checkCommandExists "rabbitmqctl"
|
||||||
|
@ -399,19 +425,19 @@ chown -R ${web_user}:${web_user} /run/airtime
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing log writer..."
|
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 "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing API client..."
|
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 "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing media-monitor..."
|
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 "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing pypo..."
|
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"
|
verbose "...Done"
|
||||||
|
|
||||||
for i in /etc/init/airtime*.template; do
|
for i in /etc/init/airtime*.template; do
|
||||||
|
@ -420,7 +446,7 @@ for i in /etc/init/airtime*.template; do
|
||||||
mv $i ${i%.template}
|
mv $i ${i%.template}
|
||||||
done
|
done
|
||||||
|
|
||||||
loudCmd "initctl reload-configuration"
|
#loudCmd "initctl reload-configuration"
|
||||||
|
|
||||||
if [ ! -d /var/log/airtime ]; then
|
if [ ! -d /var/log/airtime ]; then
|
||||||
loud "\n-----------------------------------------------------"
|
loud "\n-----------------------------------------------------"
|
||||||
|
@ -530,9 +556,6 @@ if [ "$ignore_dependencies" = "f" ]; then
|
||||||
loud " * Installing Locales * "
|
loud " * Installing Locales * "
|
||||||
loud "-----------------------------------------------------"
|
loud "-----------------------------------------------------"
|
||||||
|
|
||||||
dist=`lsb_release -is`
|
|
||||||
code=`lsb_release -cs`
|
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
verbose "\n * Generating locales"
|
verbose "\n * Generating locales"
|
||||||
for i in `ls /usr/share/airtime/locale | grep ".._.."`; do
|
for i in `ls /usr/share/airtime/locale | grep ".._.."`; do
|
||||||
|
|
|
@ -52,6 +52,7 @@ coreutils
|
||||||
|
|
||||||
liquidsoap
|
liquidsoap
|
||||||
|
|
||||||
silan
|
|
||||||
libopus0
|
libopus0
|
||||||
|
|
||||||
|
sysvinit
|
||||||
|
sysvinit-utils
|
|
@ -68,3 +68,5 @@ liquidsoap-plugin-vorbis
|
||||||
silan
|
silan
|
||||||
libopus0
|
libopus0
|
||||||
|
|
||||||
|
sysv-init
|
||||||
|
sysvinit-utils
|
|
@ -67,3 +67,6 @@ liquidsoap-plugin-vorbis
|
||||||
|
|
||||||
silan
|
silan
|
||||||
libopus0
|
libopus0
|
||||||
|
|
||||||
|
sysv-init
|
||||||
|
sysvinit-utils
|
|
@ -67,3 +67,5 @@ liquidsoap-plugin-vorbis
|
||||||
silan
|
silan
|
||||||
libopus0
|
libopus0
|
||||||
|
|
||||||
|
sysv-init
|
||||||
|
sysvinit-utils
|
|
@ -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()
|
||||||
|
|
|
@ -9,12 +9,26 @@
|
||||||
# Short-Description: Manage airtime-media-monitor daemon
|
# Short-Description: Manage airtime-media-monitor daemon
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
USERID=WEB_USER
|
USERID=www-data
|
||||||
GROUPID=WEB_USER
|
GROUPID=www-data
|
||||||
NAME=Airtime\ Media\ Monitor
|
NAME=airtime-media-monitor
|
||||||
|
|
||||||
DAEMON=/usr/lib/airtime/media-monitor/airtime-media-monitor
|
DAEMON=/usr/bin/$NAME
|
||||||
PIDFILE=/var/run/airtime/airtime-media-monitor.pid
|
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 () {
|
||||||
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \
|
start-stop-daemon --start --background --quiet --chuid $USERID:$GROUPID \
|
||||||
|
@ -48,8 +62,7 @@ case "${1:-''}" in
|
||||||
echo "Done."
|
echo "Done."
|
||||||
;;
|
;;
|
||||||
'status')
|
'status')
|
||||||
# status commands here
|
status_of_proc "$DAEMON" "$NAME" && exit 0 || exit $?
|
||||||
/usr/bin/airtime-check-system
|
|
||||||
;;
|
;;
|
||||||
*) # no parameter specified
|
*) # no parameter specified
|
||||||
echo "Usage: $SELF start|stop|restart|status"
|
echo "Usage: $SELF start|stop|restart|status"
|
||||||
|
|
|
@ -60,5 +60,5 @@ setup(name='airtime-media-monitor',
|
||||||
# Reload the initctl config so that the media-monitor service works
|
# Reload the initctl config so that the media-monitor service works
|
||||||
if data_files:
|
if data_files:
|
||||||
print "Reloading initctl configuration"
|
print "Reloading initctl configuration"
|
||||||
call(['initctl', 'reload-configuration'])
|
#call(['initctl', 'reload-configuration'])
|
||||||
print "Run \"sudo service airtime-media-monitor start\""
|
print "Run \"sudo service airtime-media-monitor start\""
|
||||||
|
|
|
@ -64,5 +64,5 @@ setup(name='airtime-playout',
|
||||||
# Reload the initctl config so that playout services works
|
# Reload the initctl config so that playout services works
|
||||||
if data_files:
|
if data_files:
|
||||||
print "Reloading initctl configuration"
|
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\""
|
print "Run \"sudo service airtime-playout start\" and \"sudo service airtime-liquidsoap start\""
|
||||||
|
|
Loading…
Reference in New Issue