Merge branch '2.5.x-installer' into saas-installer-albert
Conflicts: python_apps/pypo/pypo/pypofile.py
This commit is contained in:
commit
6ca0e340a4
13 changed files with 42 additions and 132 deletions
|
@ -66,12 +66,6 @@ $pages = array(
|
||||||
'controller' => 'Preference',
|
'controller' => 'Preference',
|
||||||
'action' => 'stream-setting'
|
'action' => 'stream-setting'
|
||||||
),
|
),
|
||||||
array(
|
|
||||||
'label' => _('Support Feedback'),
|
|
||||||
'module' => 'default',
|
|
||||||
'controller' => 'Preference',
|
|
||||||
'action' => 'support-setting'
|
|
||||||
),
|
|
||||||
array(
|
array(
|
||||||
'label' => _('Status'),
|
'label' => _('Status'),
|
||||||
'module' => 'default',
|
'module' => 'default',
|
||||||
|
|
4
install
4
install
|
@ -22,9 +22,9 @@ showhelp () {
|
||||||
No output except errors
|
No output except errors
|
||||||
-f, --force
|
-f, --force
|
||||||
Turn off interactive prompts
|
Turn off interactive prompts
|
||||||
--distribution
|
--distribution=DISTRIBUTION
|
||||||
Linux distribution the installation is being run on
|
Linux distribution the installation is being run on
|
||||||
--release
|
--release=RELEASE
|
||||||
Distribution release
|
Distribution release
|
||||||
-d, --ignore-dependencies
|
-d, --ignore-dependencies
|
||||||
Don't install binary dependencies
|
Don't install binary dependencies
|
||||||
|
|
|
@ -30,6 +30,9 @@ from configobj import ConfigObj
|
||||||
from api_clients import *
|
from api_clients import *
|
||||||
from std_err_override import LogWriter
|
from std_err_override import LogWriter
|
||||||
|
|
||||||
|
LOG_LEVEL = logging.INFO
|
||||||
|
LOG_PATH = '/var/log/airtime/pypo/notify.log'
|
||||||
|
|
||||||
# help screeen / info
|
# help screeen / info
|
||||||
usage = "%prog [options]" + " - notification gateway"
|
usage = "%prog [options]" + " - notification gateway"
|
||||||
parser = OptionParser(usage=usage)
|
parser = OptionParser(usage=usage)
|
||||||
|
@ -50,10 +53,20 @@ parser.add_option("-n", "--liquidsoap-started", help="notify liquidsoap started"
|
||||||
# parse options
|
# parse options
|
||||||
(options, args) = parser.parse_args()
|
(options, args) = parser.parse_args()
|
||||||
|
|
||||||
# configure logging
|
# Set up logging
|
||||||
logging.config.fileConfig('/etc/airtime/notify_logging.cfg')
|
logFormatter = logging.Formatter("%(asctime)s [%(module)s] [%(levelname)-5.5s] %(message)s")
|
||||||
logger = logging.getLogger('notify')
|
rootLogger = logging.getLogger()
|
||||||
LogWriter.override_std_err(logger)
|
rootLogger.setLevel(LOG_LEVEL)
|
||||||
|
|
||||||
|
fileHandler = logging.handlers.RotatingFileHandler(filename=LOG_PATH, maxBytes=1024*1024*30,
|
||||||
|
backupCount=8)
|
||||||
|
fileHandler.setFormatter(logFormatter)
|
||||||
|
rootLogger.addHandler(fileHandler)
|
||||||
|
|
||||||
|
consoleHandler = logging.StreamHandler()
|
||||||
|
consoleHandler.setFormatter(logFormatter)
|
||||||
|
rootLogger.addHandler(consoleHandler)
|
||||||
|
logger = rootLogger
|
||||||
|
|
||||||
#need to wait for Python 2.7 for this..
|
#need to wait for Python 2.7 for this..
|
||||||
#logging.captureWarnings(True)
|
#logging.captureWarnings(True)
|
||||||
|
|
|
@ -1,28 +0,0 @@
|
||||||
[loggers]
|
|
||||||
keys=root,notify
|
|
||||||
|
|
||||||
[handlers]
|
|
||||||
keys=notify
|
|
||||||
|
|
||||||
[formatters]
|
|
||||||
keys=simpleFormatter
|
|
||||||
|
|
||||||
[logger_root]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=notify
|
|
||||||
|
|
||||||
[logger_notify]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=notify
|
|
||||||
qualname=notify
|
|
||||||
propagate=0
|
|
||||||
|
|
||||||
[handler_notify]
|
|
||||||
class=logging.handlers.RotatingFileHandler
|
|
||||||
level=DEBUG
|
|
||||||
formatter=simpleFormatter
|
|
||||||
args=("/var/log/airtime/pypo/notify.log", 'a', 1000000, 5,)
|
|
||||||
|
|
||||||
[formatter_simpleFormatter]
|
|
||||||
format=%(asctime)s %(levelname)s - [%(filename)s : %(funcName)s() : line %(lineno)d] - %(message)s
|
|
||||||
datefmt=
|
|
|
@ -1,58 +0,0 @@
|
||||||
[loggers]
|
|
||||||
keys=root,fetch,push,recorder,message_h
|
|
||||||
|
|
||||||
[handlers]
|
|
||||||
keys=pypo,recorder,message_h
|
|
||||||
|
|
||||||
[formatters]
|
|
||||||
keys=simpleFormatter
|
|
||||||
|
|
||||||
[logger_root]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=pypo
|
|
||||||
|
|
||||||
[logger_fetch]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=pypo
|
|
||||||
qualname=fetch
|
|
||||||
propagate=0
|
|
||||||
|
|
||||||
[logger_push]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=pypo
|
|
||||||
qualname=push
|
|
||||||
propagate=0
|
|
||||||
|
|
||||||
[logger_recorder]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=recorder
|
|
||||||
qualname=recorder
|
|
||||||
propagate=0
|
|
||||||
|
|
||||||
[logger_message_h]
|
|
||||||
level=DEBUG
|
|
||||||
handlers=message_h
|
|
||||||
qualname=message_h
|
|
||||||
propagate=0
|
|
||||||
|
|
||||||
[handler_pypo]
|
|
||||||
class=logging.handlers.RotatingFileHandler
|
|
||||||
level=DEBUG
|
|
||||||
formatter=simpleFormatter
|
|
||||||
args=("/var/log/airtime/pypo/pypo.log", 'a', 5000000, 10,)
|
|
||||||
|
|
||||||
[handler_recorder]
|
|
||||||
class=logging.handlers.RotatingFileHandler
|
|
||||||
level=DEBUG
|
|
||||||
formatter=simpleFormatter
|
|
||||||
args=("/var/log/airtime/pypo/show-recorder.log", 'a', 1000000, 5,)
|
|
||||||
|
|
||||||
[handler_message_h]
|
|
||||||
class=logging.handlers.RotatingFileHandler
|
|
||||||
level=DEBUG
|
|
||||||
formatter=simpleFormatter
|
|
||||||
args=("/var/log/airtime/pypo/message-handler.log", 'a', 1000000, 5,)
|
|
||||||
|
|
||||||
[formatter_simpleFormatter]
|
|
||||||
format=%(asctime)s %(levelname)s - [%(filename)s : %(funcName)s() : line %(lineno)d] - %(message)s
|
|
||||||
datefmt=
|
|
|
@ -1,4 +1,5 @@
|
||||||
import logging
|
import logging
|
||||||
|
import os
|
||||||
import sys
|
import sys
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
|
@ -28,7 +29,9 @@ def generate_liquidsoap_config(ss):
|
||||||
# ignore squashes unused variable errors from Liquidsoap
|
# ignore squashes unused variable errors from Liquidsoap
|
||||||
fh.write(("ignore(%s)\n" % key).encode('utf-8'))
|
fh.write(("ignore(%s)\n" % key).encode('utf-8'))
|
||||||
|
|
||||||
|
auth_path = os.path.dirname(os.path.realpath(__file__))
|
||||||
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
|
fh.write('log_file = "/var/log/airtime/pypo-liquidsoap/<script>.log"\n')
|
||||||
|
fh.write('auth_path = "%s/liquidsoap_auth.py"\n' % auth_path)
|
||||||
fh.close()
|
fh.close()
|
||||||
|
|
||||||
def run():
|
def run():
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
set("log.file.path", log_file)
|
set("log.file.path", log_file)
|
||||||
set("server.telnet", true)
|
set("server.telnet", true)
|
||||||
set("server.telnet.port", 1234)
|
set("server.telnet.port", 1234)
|
||||||
set("init.daemon.pidfile.path", "/var/run/airtime/airtime-liquidsoap.pid")
|
# set("init.daemon.pidfile.path", "/var/run/airtime/airtime-liquidsoap.pid")
|
||||||
|
|
||||||
%include "library/pervasives.liq"
|
%include "library/pervasives.liq"
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ end
|
||||||
def check_master_dj_client(user,password) =
|
def check_master_dj_client(user,password) =
|
||||||
log("master connected")
|
log("master connected")
|
||||||
#get the output of the php script
|
#get the output of the php script
|
||||||
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --master #{user} #{password}")
|
ret = get_process_lines("python #{auth_path} --master #{user} #{password}")
|
||||||
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
||||||
ret = list.hd(ret)
|
ret = list.hd(ret)
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ end
|
||||||
def check_dj_client(user,password) =
|
def check_dj_client(user,password) =
|
||||||
log("live dj connected")
|
log("live dj connected")
|
||||||
#get the output of the php script
|
#get the output of the php script
|
||||||
ret = get_process_lines("python /usr/lib/airtime/pypo/bin/liquidsoap_scripts/liquidsoap_auth.py --dj #{user} #{password}")
|
ret = get_process_lines("python #{auth_path} --dj #{user} #{password}")
|
||||||
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
#ret has now the value of the live client (dj1,dj2, or djx), or "ERROR"/"unknown" ...
|
||||||
hd = list.hd(ret)
|
hd = list.hd(ret)
|
||||||
log("Live DJ authenticated: #{hd}")
|
log("Live DJ authenticated: #{hd}")
|
||||||
|
|
|
@ -31,9 +31,12 @@ from configobj import ConfigObj
|
||||||
|
|
||||||
# custom imports
|
# custom imports
|
||||||
from api_clients import api_client
|
from api_clients import api_client
|
||||||
from std_err_override import LogWriter
|
#from std_err_override import LogWriter
|
||||||
import pure
|
import pure
|
||||||
|
|
||||||
|
LOG_PATH = '/var/log/airtime/pypo/pypo.log'
|
||||||
|
LOG_LEVEL = logging.INFO
|
||||||
|
|
||||||
# Set up command-line options
|
# Set up command-line options
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
|
|
||||||
|
@ -86,9 +89,15 @@ logging.captureWarnings(True)
|
||||||
|
|
||||||
# configure logging
|
# configure logging
|
||||||
try:
|
try:
|
||||||
logging.config.fileConfig("/etc/airtime/pypo_logging.cfg")
|
# Set up logging
|
||||||
logger = logging.getLogger()
|
logFormatter = logging.Formatter("%(asctime)s [%(module)s] [%(levelname)-5.5s] %(message)s")
|
||||||
LogWriter.override_std_err(logger)
|
rootLogger = logging.getLogger()
|
||||||
|
rootLogger.setLevel(LOG_LEVEL)
|
||||||
|
logger = rootLogger
|
||||||
|
|
||||||
|
consoleHandler = logging.StreamHandler()
|
||||||
|
consoleHandler.setFormatter(logFormatter)
|
||||||
|
rootLogger.addHandler(consoleHandler)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
print "Couldn't configure logging", e
|
print "Couldn't configure logging", e
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -294,6 +303,9 @@ if __name__ == '__main__':
|
||||||
stat.daemon = True
|
stat.daemon = True
|
||||||
stat.start()
|
stat.start()
|
||||||
|
|
||||||
pf.join()
|
# Just sleep the main thread, instead of blocking on pf.join().
|
||||||
|
# This allows CTRL-C to work!
|
||||||
|
while True:
|
||||||
|
time.sleep(1)
|
||||||
|
|
||||||
logger.info("System exit")
|
logger.info("System exit")
|
||||||
|
|
|
@ -22,12 +22,6 @@ from std_err_override import LogWriter
|
||||||
from timeout import ls_timeout
|
from timeout import ls_timeout
|
||||||
|
|
||||||
|
|
||||||
# configure logging
|
|
||||||
logging_cfg = "/etc/airtime/pypo_logging.cfg"
|
|
||||||
logging.config.fileConfig(logging_cfg)
|
|
||||||
logger = logging.getLogger()
|
|
||||||
LogWriter.override_std_err(logger)
|
|
||||||
|
|
||||||
def keyboardInterruptHandler(signum, frame):
|
def keyboardInterruptHandler(signum, frame):
|
||||||
logger = logging.getLogger()
|
logger = logging.getLogger()
|
||||||
logger.info('\nKeyboard Interrupt\n')
|
logger.info('\nKeyboard Interrupt\n')
|
||||||
|
|
|
@ -18,12 +18,6 @@ from std_err_override import LogWriter
|
||||||
|
|
||||||
CONFIG_PATH = '/etc/airtime/airtime.conf'
|
CONFIG_PATH = '/etc/airtime/airtime.conf'
|
||||||
|
|
||||||
# configure logging
|
|
||||||
logging_cfg = "/etc/airtime/pypo_logging.cfg"
|
|
||||||
logging.config.fileConfig(logging_cfg)
|
|
||||||
logger = logging.getLogger()
|
|
||||||
LogWriter.override_std_err(logger)
|
|
||||||
|
|
||||||
#need to wait for Python 2.7 for this..
|
#need to wait for Python 2.7 for this..
|
||||||
#logging.captureWarnings(True)
|
#logging.captureWarnings(True)
|
||||||
|
|
||||||
|
|
|
@ -15,12 +15,6 @@ import json
|
||||||
|
|
||||||
from std_err_override import LogWriter
|
from std_err_override import LogWriter
|
||||||
|
|
||||||
# configure logging
|
|
||||||
logging_cfg = "/etc/airtime/pypo_logging.cfg"
|
|
||||||
logging.config.fileConfig(logging_cfg)
|
|
||||||
logger = logging.getLogger('message_h')
|
|
||||||
LogWriter.override_std_err(logger)
|
|
||||||
|
|
||||||
#need to wait for Python 2.7 for this..
|
#need to wait for Python 2.7 for this..
|
||||||
#logging.captureWarnings(True)
|
#logging.captureWarnings(True)
|
||||||
|
|
||||||
|
|
|
@ -25,12 +25,6 @@ from std_err_override import LogWriter
|
||||||
from timeout import ls_timeout
|
from timeout import ls_timeout
|
||||||
|
|
||||||
|
|
||||||
# configure logging
|
|
||||||
logging_cfg = "/etc/airtime/pypo_logging.cfg"
|
|
||||||
logging.config.fileConfig(logging_cfg)
|
|
||||||
logger = logging.getLogger()
|
|
||||||
LogWriter.override_std_err(logger)
|
|
||||||
|
|
||||||
#need to wait for Python 2.7 for this..
|
#need to wait for Python 2.7 for this..
|
||||||
#logging.captureWarnings(True)
|
#logging.captureWarnings(True)
|
||||||
|
|
||||||
|
|
|
@ -22,8 +22,6 @@ else:
|
||||||
('/etc/init', ['install/upstart/airtime-liquidsoap.conf.template']),
|
('/etc/init', ['install/upstart/airtime-liquidsoap.conf.template']),
|
||||||
('/etc/init.d', ['install/sysvinit/airtime-playout']),
|
('/etc/init.d', ['install/sysvinit/airtime-playout']),
|
||||||
('/etc/init.d', ['install/sysvinit/airtime-liquidsoap']),
|
('/etc/init.d', ['install/sysvinit/airtime-liquidsoap']),
|
||||||
('/etc/airtime', ['install/notify_logging.cfg']),
|
|
||||||
('/etc/airtime', ['install/pypo_logging.cfg']),
|
|
||||||
('/var/log/airtime/pypo', []),
|
('/var/log/airtime/pypo', []),
|
||||||
('/var/log/airtime/pypo-liquidsoap', []),
|
('/var/log/airtime/pypo-liquidsoap', []),
|
||||||
('/var/tmp/airtime/pypo', []),
|
('/var/tmp/airtime/pypo', []),
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue