From 38f8a0d23156e4951a64d7cd0a7b13ceb43f1225 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 24 Mar 2013 22:58:13 -0400 Subject: [PATCH 1/2] more robust handling if system permissions go wrong --- python_apps/pypo/airtime-liquidsoap-init-d | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/python_apps/pypo/airtime-liquidsoap-init-d b/python_apps/pypo/airtime-liquidsoap-init-d index 9826423ef..37956a265 100755 --- a/python_apps/pypo/airtime-liquidsoap-init-d +++ b/python_apps/pypo/airtime-liquidsoap-init-d @@ -35,12 +35,14 @@ stop () { start_no_monit() { chown pypo:pypo /var/log/airtime/pypo chown pypo:pypo /var/log/airtime/pypo-liquidsoap + chown pypo:pypo /etc/airtime/liquidsoap.cfg - touch /var/run/airtime-liquidsoap.pid - chown pypo:pypo /var/run/airtime-liquidsoap.pid + rm -f $PIDFILE + touch $PIDFILE + chown pypo:pypo $PIDFILE start-stop-daemon --start --quiet --chuid $USERID:$GROUPID \ - --pidfile /var/run/airtime-liquidsoap.pid --nicelevel -15 --startas $DAEMON + --pidfile $PIDFILE --nicelevel -15 --startas $DAEMON } @@ -64,8 +66,8 @@ case "${1:-''}" in ;; 'status') - if [ -f "/var/run/airtime-liquidsoap.pid" ]; then - pid=`cat /var/run/airtime-liquidsoap.pid` + if [ -f "$PIDFILE" ]; then + pid=`cat $PIDFILE` if [ -d "/proc/$pid" ]; then echo "Liquidsoap is running" exit 0 From 265ac49f2e52b0c0c9aea1007aa7ed48d8fd147d Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Sun, 24 Mar 2013 23:11:55 -0400 Subject: [PATCH 2/2] remove duplicate cc_config --- airtime_mvc/application/Bootstrap.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/airtime_mvc/application/Bootstrap.php b/airtime_mvc/application/Bootstrap.php index 38d4d9c7a..e289e9c54 100644 --- a/airtime_mvc/application/Bootstrap.php +++ b/airtime_mvc/application/Bootstrap.php @@ -17,15 +17,12 @@ require_once "Timezone.php"; require_once __DIR__.'/forms/helpers/ValidationTypes.php'; require_once __DIR__.'/controllers/plugins/RabbitMqPlugin.php'; - - date_default_timezone_set('UTC'); require_once (APPLICATION_PATH."/logging/Logging.php"); Logging::setLogPath('/var/log/airtime/zendphp.log'); date_default_timezone_set(Application_Model_Preference::GetTimezone()); Config::setAirtimeVersion(); -$CC_CONFIG = Config::getConfig(); require_once __DIR__."/configs/navigation.php"; Zend_Validate::setDefaultNamespaces("Zend");