CC-2758: Make airtime-install script Debian/Ubuntu compatible
-install complete
This commit is contained in:
parent
cd0ff848fc
commit
87970740a0
6 changed files with 69 additions and 58 deletions
|
@ -40,53 +40,6 @@ SCRIPTPATH=`dirname $SCRIPT`
|
||||||
python $SCRIPTPATH/../python_apps/create-pypo-user.py
|
python $SCRIPTPATH/../python_apps/create-pypo-user.py
|
||||||
|
|
||||||
$SCRIPTPATH/include/airtime-copy-files.sh
|
$SCRIPTPATH/include/airtime-copy-files.sh
|
||||||
|
$SCRIPTPATH/include/airtime-initialize.sh $@
|
||||||
${SCRIPTPATH}/../python_apps/python-virtualenv/virtualenv-install.sh
|
|
||||||
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
|
||||||
. ${virtualenv_bin}activate
|
|
||||||
|
|
||||||
set +e
|
|
||||||
php --php-ini ${SCRIPTPATH}/airtime-php.ini ${SCRIPTPATH}/include/airtime-install.php $@
|
|
||||||
result=$?
|
|
||||||
|
|
||||||
if [ "$result" -ne "0" ]; then
|
|
||||||
#There was an error, exit with error code.
|
|
||||||
echo "There was an error during upgrade. Exit code $result"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
set -e
|
|
||||||
|
|
||||||
python $SCRIPTPATH/../python_apps/pypo/install/pypo-initialize.py
|
|
||||||
python $SCRIPTPATH/../python_apps/media-monitor/install/media-monitor-initialize.py
|
|
||||||
python $SCRIPTPATH/../python_apps/show-recorder/install/recorder-initialize.py
|
|
||||||
|
|
||||||
# Start monit if it is not running, or restart if it is.
|
|
||||||
# Need to ensure monit is running before Airtime daemons are run. This is
|
|
||||||
# so we can ensure they can register with monit to monitor them when they start.
|
|
||||||
# If monit is already running, this step is still useful as we need monit to
|
|
||||||
# reload its config files.
|
|
||||||
|
|
||||||
echo "Restarting"
|
|
||||||
/etc/init.d/monit restart
|
|
||||||
echo "Restarting Done"
|
|
||||||
|
|
||||||
#give monit some time to boot-up before issuing commands
|
|
||||||
sleep 1
|
|
||||||
|
|
||||||
set +e
|
|
||||||
monit monitor airtime-media-monitor
|
|
||||||
sleep 0.5
|
|
||||||
monit monitor airtime-liquidsoap
|
|
||||||
sleep 0.5
|
|
||||||
monit monitor airtime-playout
|
|
||||||
sleep 0.5
|
|
||||||
monit monitor airtime-show-recorder
|
|
||||||
sleep 0.5
|
|
||||||
monit monitor rabbitmq-server
|
|
||||||
set -e
|
|
||||||
|
|
||||||
echo -e "\n*** Verifying your system environment ***"
|
|
||||||
sleep 10
|
|
||||||
airtime-check-system
|
|
||||||
|
|
||||||
echo -e "\n******************************* Install Complete *******************************"
|
echo -e "\n******************************* Install Complete *******************************"
|
||||||
|
|
57
install_minimal/include/airtime-initialize.sh
Executable file
57
install_minimal/include/airtime-initialize.sh
Executable file
|
@ -0,0 +1,57 @@
|
||||||
|
#!/bin/bash -e
|
||||||
|
#-e Causes bash script to exit if any of the installers
|
||||||
|
#return with a non-zero return value.
|
||||||
|
|
||||||
|
if [ `whoami` != 'root' ]; then
|
||||||
|
echo "Please run as root user."
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Absolute path to this script, e.g. /home/user/bin/foo.sh
|
||||||
|
SCRIPT=`readlink -f $0`
|
||||||
|
# Absolute path this script is in, thus /home/user/bin
|
||||||
|
SCRIPTPATH=`dirname $SCRIPT`
|
||||||
|
|
||||||
|
AIRTIMEROOT=$SCRIPTPATH/../../
|
||||||
|
|
||||||
|
$AIRTIMEROOT/python_apps/python-virtualenv/virtualenv-install.sh
|
||||||
|
virtualenv_bin="/usr/lib/airtime/airtime_virtualenv/bin/"
|
||||||
|
. ${virtualenv_bin}activate
|
||||||
|
|
||||||
|
set +e
|
||||||
|
php --php-ini ${SCRIPTPATH}/../airtime-php.ini ${SCRIPTPATH}/airtime-install.php $@
|
||||||
|
result=$?
|
||||||
|
|
||||||
|
if [ "$result" -ne "0" ]; then
|
||||||
|
#There was an error, exit with error code.
|
||||||
|
echo "There was an error during upgrade. Exit code $result"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
set -e
|
||||||
|
|
||||||
|
python $AIRTIMEROOT/python_apps/pypo/install/pypo-initialize.py
|
||||||
|
python $AIRTIMEROOT/python_apps/media-monitor/install/media-monitor-initialize.py
|
||||||
|
python $AIRTIMEROOT/python_apps/show-recorder/install/recorder-initialize.py
|
||||||
|
|
||||||
|
# Start monit if it is not running, or restart if it is.
|
||||||
|
# Need to ensure monit is running before Airtime daemons are run. This is
|
||||||
|
# so we can ensure they can register with monit to monitor them when they start.
|
||||||
|
# If monit is already running, this step is still useful as we need monit to
|
||||||
|
# reload its config files.
|
||||||
|
/etc/init.d/monit restart
|
||||||
|
|
||||||
|
#give monit some time to boot-up before issuing commands
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
set +e
|
||||||
|
monit monitor airtime-media-monitor
|
||||||
|
monit monitor airtime-liquidsoap
|
||||||
|
monit monitor airtime-playout
|
||||||
|
monit monitor airtime-show-recorder
|
||||||
|
#monit monitor rabbitmq-server
|
||||||
|
set -e
|
||||||
|
|
||||||
|
echo -e "\n*** Verifying your system environment ***"
|
||||||
|
sleep 10
|
||||||
|
airtime-check-system
|
||||||
|
|
|
@ -112,16 +112,13 @@ if (isset($opts->o) || $newInstall == true) {
|
||||||
if ($overwrite) {
|
if ($overwrite) {
|
||||||
echo "* Creating INI files".PHP_EOL;
|
echo "* Creating INI files".PHP_EOL;
|
||||||
AirtimeIni::CreateIniFiles();
|
AirtimeIni::CreateIniFiles();
|
||||||
}
|
|
||||||
|
|
||||||
//AirtimeInstall::InstallPhpCode();
|
|
||||||
//AirtimeInstall::InstallBinaries();
|
|
||||||
|
|
||||||
if ($overwrite) {
|
|
||||||
echo "* Initializing INI files".PHP_EOL;
|
echo "* Initializing INI files".PHP_EOL;
|
||||||
AirtimeIni::UpdateIniFiles();
|
AirtimeIni::UpdateIniFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//AirtimeInstall::InstallPhpCode(); //copies contents of airtime_mvc to /usr/share
|
||||||
|
//AirtimeInstall::InstallBinaries(); //copies utils to /usr/lib/airtime
|
||||||
|
|
||||||
// Update the build.properties file to point to the correct directory.
|
// Update the build.properties file to point to the correct directory.
|
||||||
AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW.'/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW);
|
AirtimeIni::UpdateIniValue(AirtimeInstall::CONF_DIR_WWW.'/build/build.properties', 'project.home', AirtimeInstall::CONF_DIR_WWW);
|
||||||
|
|
||||||
|
@ -141,10 +138,10 @@ if ($db_install) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#AirtimeInstall::CreateSymlinksToUtils();
|
//AirtimeInstall::CreateSymlinksToUtils();
|
||||||
|
|
||||||
AirtimeInstall::CreateZendPhpLogFile();
|
AirtimeInstall::CreateZendPhpLogFile();
|
||||||
|
|
||||||
#AirtimeInstall::CreateCronFile();
|
//AirtimeInstall::CreateCronFile();
|
||||||
|
|
||||||
/* FINISHED AIRTIME PHP INSTALLER */
|
/* FINISHED AIRTIME PHP INSTALLER */
|
||||||
|
|
|
@ -11,7 +11,9 @@ try:
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
#Start media-monitor daemon
|
#Start media-monitor daemon
|
||||||
|
print "Waiting for media-monitor processes to start..."
|
||||||
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
p = Popen("/etc/init.d/airtime-media-monitor stop", shell=True)
|
||||||
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
p = Popen("/etc/init.d/airtime-media-monitor start-no-monit", shell=True)
|
p = Popen("/etc/init.d/airtime-media-monitor start-no-monit", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
|
@ -101,8 +101,9 @@ try:
|
||||||
print "Unable to connect to the Airtime server."
|
print "Unable to connect to the Airtime server."
|
||||||
|
|
||||||
#restart airtime-playout
|
#restart airtime-playout
|
||||||
print "Waiting for processes to start..."
|
print "Waiting for pypo processes to start..."
|
||||||
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
|
p = Popen("/etc/init.d/airtime-playout stop", shell=True)
|
||||||
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
p = Popen("/etc/init.d/airtime-playout start-no-monit", shell=True)
|
p = Popen("/etc/init.d/airtime-playout start-no-monit", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
|
|
|
@ -12,8 +12,9 @@ try:
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
|
|
||||||
#start daemon
|
#start daemon
|
||||||
print "Waiting for processes to start..."
|
print "Waiting for show-recorder processes to start..."
|
||||||
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
p = Popen("/etc/init.d/airtime-show-recorder stop", shell=True)
|
||||||
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
p = Popen("/etc/init.d/airtime-show-recorder start-no-monit", shell=True)
|
p = Popen("/etc/init.d/airtime-show-recorder start-no-monit", shell=True)
|
||||||
sts = os.waitpid(p.pid, 0)[1]
|
sts = os.waitpid(p.pid, 0)[1]
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue