Merge pull request #1373 from jooola/feat/rename_python_packages
Rename python packages/entrypoints
This commit is contained in:
commit
2f3adac09d
|
@ -11,8 +11,8 @@ usage() {
|
|||
|
||||
if [ "$1" = "--enable" ]; then
|
||||
|
||||
/etc/init.d/airtime-playout stop
|
||||
/etc/init.d/airtime-playout start-liquidsoap
|
||||
/etc/init.d/libretime-playout stop
|
||||
/etc/init.d/libretime-playout start-liquidsoap
|
||||
|
||||
user=$2
|
||||
|
||||
|
@ -30,8 +30,8 @@ elif [ "$1" = "--disable" ]; then
|
|||
chown -Rv $user:$user /var/tmp/airtime/pypo/
|
||||
chmod -v a+r /etc/airtime/api_client.cfg
|
||||
|
||||
/etc/init.d/airtime-playout stop-liquidsoap
|
||||
/etc/init.d/airtime-playout start
|
||||
/etc/init.d/libretime-playout stop-liquidsoap
|
||||
/etc/init.d/libretime-playout start
|
||||
else
|
||||
usage
|
||||
fi
|
||||
|
|
2
install
2
install
|
@ -1015,7 +1015,7 @@ if [ ! -d /var/log/airtime ]; then
|
|||
|
||||
verbose "\n * Copying logrotate files..."
|
||||
loudCmd "cp ${AIRTIMEROOT}/legacy/build/airtime-php.logrotate /etc/logrotate.d/airtime-php"
|
||||
loudCmd "cp ${AIRTIMEROOT}/python_apps/pypo/liquidsoap/airtime-liquidsoap.logrotate /etc/logrotate.d/airtime-liquidsoap"
|
||||
loudCmd "cp ${AIRTIMEROOT}/python_apps/pypo/liquidsoap/logrotate.conf /etc/logrotate.d/libretime-liquidsoap"
|
||||
fi
|
||||
|
||||
verbose "\n * Installing API client..."
|
||||
|
|
|
@ -5,15 +5,15 @@ class Application_Model_Systemstatus
|
|||
public static function GetMonitStatus($p_ip)
|
||||
{
|
||||
$CC_CONFIG = Config::getConfig();
|
||||
// $monit_user = $CC_CONFIG['monit_user'];
|
||||
// $monit_password = $CC_CONFIG['monit_password'];
|
||||
// $monit_user = $CC_CONFIG['monit_user'];
|
||||
// $monit_password = $CC_CONFIG['monit_password'];
|
||||
|
||||
$url = "http://{$p_ip}:2812/_status?format=xml";
|
||||
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
// curl_setopt($ch, CURLOPT_USERPWD, "$monit_user:$monit_password");
|
||||
// curl_setopt($ch, CURLOPT_USERPWD, "$monit_user:$monit_password");
|
||||
//wait a max of 3 seconds before aborting connection attempt
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 3);
|
||||
$result = curl_exec($ch);
|
||||
|
@ -42,7 +42,8 @@ class Application_Model_Systemstatus
|
|||
'status' => 0,
|
||||
'memory_perc' => '0%',
|
||||
'memory_kb' => '0',
|
||||
'cpu_perc' => '0%', ];
|
||||
'cpu_perc' => '0%',
|
||||
];
|
||||
|
||||
$notMonitored = [
|
||||
'name' => $p_serviceName,
|
||||
|
@ -153,7 +154,7 @@ class Application_Model_Systemstatus
|
|||
|
||||
$docRoot = self::GetMonitStatus($ip);
|
||||
|
||||
return self::ExtractServiceInformation($docRoot, 'airtime-playout');
|
||||
return self::ExtractServiceInformation($docRoot, 'libretime-playout');
|
||||
}
|
||||
|
||||
public static function GetLiquidsoapStatus()
|
||||
|
@ -166,7 +167,7 @@ class Application_Model_Systemstatus
|
|||
|
||||
$docRoot = self::GetMonitStatus($ip);
|
||||
|
||||
return self::ExtractServiceInformation($docRoot, 'airtime-liquidsoap');
|
||||
return self::ExtractServiceInformation($docRoot, 'libretime-liquidsoap');
|
||||
}
|
||||
|
||||
public static function GetMediaMonitorStatus()
|
||||
|
|
|
@ -136,13 +136,13 @@ function checkAnalyzerService()
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if airtime-playout is currently running.
|
||||
* Check if libretime-playout is currently running.
|
||||
*
|
||||
* @return bool true if airtime-playout is running
|
||||
* @return bool true if libretime-playout is running
|
||||
*/
|
||||
function checkPlayoutService()
|
||||
{
|
||||
exec('pgrep -f airtime-playout', $out, $status);
|
||||
exec('pgrep -f libretime-playout', $out, $status);
|
||||
if ($out > 0) {
|
||||
return posix_kill(rtrim($out[0]), 0);
|
||||
}
|
||||
|
@ -151,13 +151,13 @@ function checkPlayoutService()
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if airtime-liquidsoap is currently running.
|
||||
* Check if libretime-liquidsoap is currently running.
|
||||
*
|
||||
* @return bool true if airtime-liquidsoap is running
|
||||
* @return bool true if libretime-liquidsoap is running
|
||||
*/
|
||||
function checkLiquidsoapService()
|
||||
{
|
||||
exec('pgrep -f airtime-liquidsoap', $out, $status);
|
||||
exec('pgrep -f libretime-liquidsoap', $out, $status);
|
||||
if ($out > 0) {
|
||||
return posix_kill(rtrim($out[0]), 0);
|
||||
}
|
||||
|
@ -166,9 +166,9 @@ function checkLiquidsoapService()
|
|||
}
|
||||
|
||||
/**
|
||||
* Check if airtime-celery is currently running.
|
||||
* Check if libretime-celery is currently running.
|
||||
*
|
||||
* @return bool true if airtime-celery is running
|
||||
* @return bool true if libretime-celery is running
|
||||
*/
|
||||
function checkCeleryService()
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ from setuptools import setup
|
|||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
setup(
|
||||
name="airtime-celery",
|
||||
name="libretime-celery",
|
||||
version="0.1",
|
||||
description="LibreTime Celery",
|
||||
author="LibreTime Contributors",
|
||||
|
|
|
@ -6,7 +6,7 @@ from setuptools import setup
|
|||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
|
||||
setup(
|
||||
name="api_clients",
|
||||
name="libretime-api-client",
|
||||
version="2.0.0",
|
||||
description="LibreTime API Client",
|
||||
author="LibreTime Contributors",
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
Description=Libretime Liquidsoap Service
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/airtime-liquidsoap
|
||||
ExecStart=/usr/local/bin/libretime-liquidsoap
|
||||
User=libretime-playout
|
||||
Group=libretime-playout
|
||||
Restart=always
|
||||
|
|
|
@ -3,7 +3,7 @@ Description=Libretime Playout Service
|
|||
After=network-online.target
|
||||
|
||||
[Service]
|
||||
ExecStart=/usr/local/bin/airtime-playout
|
||||
ExecStart=/usr/local/bin/libretime-playout
|
||||
User=libretime-pypo
|
||||
Group=libretime-pypo
|
||||
Restart=always
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
def notify(m)
|
||||
command = "timeout --signal=KILL 45 pyponotify --media-id=#{m['schedule_table_id']} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --media-id=#{m['schedule_table_id']} &"
|
||||
log(command)
|
||||
system(command)
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ def notify_stream(m)
|
|||
#if a string has a single apostrophe in it, let's comment it out by ending the string before right before it
|
||||
#escaping the apostrophe, and then starting a new string right after it. This is why we use 3 apostrophes.
|
||||
json_str = string.replace(pattern="'",(fun (s) -> "'\''"), json_str)
|
||||
command = "timeout --signal=KILL 45 pyponotify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &"
|
||||
|
||||
if !current_dyn_id != "-1" then
|
||||
log(command)
|
||||
|
@ -97,14 +97,14 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
|
|||
source = ref s
|
||||
def on_error(msg)
|
||||
connected := "false"
|
||||
command = "timeout --signal=KILL 45 pyponotify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &"
|
||||
system(command)
|
||||
log(command)
|
||||
5.
|
||||
end
|
||||
def on_connect()
|
||||
connected := "true"
|
||||
command = "timeout --signal=KILL 45 pyponotify --connect --stream-id=#{stream} --time=#{!time} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --connect --stream-id=#{stream} --time=#{!time} &"
|
||||
system(command)
|
||||
log(command)
|
||||
end
|
||||
|
|
|
@ -212,7 +212,7 @@ def make_scheduled_play_unavailable()
|
|||
end
|
||||
|
||||
def update_source_status(sourcename, status) =
|
||||
command = "timeout --signal=KILL 45 pyponotify --source-name=#{sourcename} --source-status=#{status} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --source-name=#{sourcename} --source-status=#{status} &"
|
||||
system(command)
|
||||
log(command)
|
||||
end
|
||||
|
@ -438,6 +438,6 @@ if s4_enable == true then
|
|||
end
|
||||
|
||||
|
||||
command = "timeout --signal=KILL 45 pyponotify --liquidsoap-started &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --liquidsoap-started &"
|
||||
log(command)
|
||||
system(command)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
def notify(m)
|
||||
command = "timeout --signal=KILL 45 pyponotify --media-id=#{m['schedule_table_id']} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --media-id=#{m['schedule_table_id']} &"
|
||||
log(command)
|
||||
system(command)
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ def notify_stream(m)
|
|||
#if a string has a single apostrophe in it, let's comment it out by ending the string before right before it
|
||||
#escaping the apostrophe, and then starting a new string right after it. This is why we use 3 apostrophes.
|
||||
json_str = string.replace(pattern="'",(fun (s) -> "'\''"), json_str)
|
||||
command = "timeout --signal=KILL 45 pyponotify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &"
|
||||
|
||||
if !current_dyn_id != "-1" then
|
||||
log(command)
|
||||
|
@ -97,14 +97,14 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
|
|||
source = ref s
|
||||
def on_error(msg)
|
||||
connected := "false"
|
||||
command = "timeout --signal=KILL 45 pyponotify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &"
|
||||
system(command)
|
||||
log(command)
|
||||
5.
|
||||
end
|
||||
def on_connect()
|
||||
connected := "true"
|
||||
command = "timeout --signal=KILL 45 pyponotify --connect --stream-id=#{stream} --time=#{!time} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --connect --stream-id=#{stream} --time=#{!time} &"
|
||||
system(command)
|
||||
log(command)
|
||||
end
|
||||
|
|
|
@ -212,7 +212,7 @@ def make_scheduled_play_unavailable()
|
|||
end
|
||||
|
||||
def update_source_status(sourcename, status) =
|
||||
command = "timeout --signal=KILL 45 pyponotify --source-name=#{sourcename} --source-status=#{status} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --source-name=#{sourcename} --source-status=#{status} &"
|
||||
system(command)
|
||||
log(command)
|
||||
end
|
||||
|
@ -452,6 +452,6 @@ if s4_enable == true then
|
|||
end
|
||||
|
||||
|
||||
command = "timeout --signal=KILL 45 pyponotify --liquidsoap-started &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --liquidsoap-started &"
|
||||
log(command)
|
||||
system(command)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
def notify(m)
|
||||
command = "timeout --signal=KILL 45 pyponotify --media-id=#{m['schedule_table_id']} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --media-id=#{m['schedule_table_id']} &"
|
||||
log(command)
|
||||
system(command)
|
||||
end
|
||||
|
@ -15,7 +15,7 @@ def notify_stream(m)
|
|||
#if a string has a single apostrophe in it, let's comment it out by ending the string before right before it
|
||||
#escaping the apostrophe, and then starting a new string right after it. This is why we use 3 apostrophes.
|
||||
json_str = string.replace(pattern="'",(fun (s) -> "'\''"), json_str)
|
||||
command = "timeout --signal=KILL 45 pyponotify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --webstream='#{json_str}' --media-id=#{!current_dyn_id} &"
|
||||
|
||||
if !current_dyn_id != "-1" then
|
||||
log(command)
|
||||
|
@ -88,14 +88,14 @@ def output_to(output_type, type, bitrate, host, port, pass, mount_point, url, de
|
|||
source = ref s
|
||||
def on_error(msg)
|
||||
connected := "false"
|
||||
command = "timeout --signal=KILL 45 pyponotify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --error='#{msg}' --stream-id=#{stream} --time=#{!time} &"
|
||||
system(command)
|
||||
log(command)
|
||||
5.
|
||||
end
|
||||
def on_connect()
|
||||
connected := "true"
|
||||
command = "timeout --signal=KILL 45 pyponotify --connect --stream-id=#{stream} --time=#{!time} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --connect --stream-id=#{stream} --time=#{!time} &"
|
||||
system(command)
|
||||
log(command)
|
||||
end
|
||||
|
|
|
@ -215,7 +215,7 @@ def make_scheduled_play_unavailable()
|
|||
end
|
||||
|
||||
def update_source_status(sourcename, status) =
|
||||
command = "timeout --signal=KILL 45 pyponotify --source-name=#{sourcename} --source-status=#{status} &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --source-name=#{sourcename} --source-status=#{status} &"
|
||||
system(command)
|
||||
log(command)
|
||||
end
|
||||
|
@ -455,6 +455,6 @@ if s4_enable == true then
|
|||
end
|
||||
|
||||
|
||||
command = "timeout --signal=KILL 45 pyponotify --liquidsoap-started &"
|
||||
command = "timeout --signal=KILL 45 libretime-playout-notify --liquidsoap-started &"
|
||||
log(command)
|
||||
system(command)
|
||||
|
|
|
@ -36,7 +36,7 @@ def run():
|
|||
)
|
||||
exec_args = [
|
||||
"/usr/bin/liquidsoap",
|
||||
"airtime-liquidsoap",
|
||||
"libretime-liquidsoap",
|
||||
script_path,
|
||||
"--verbose",
|
||||
"-f",
|
||||
|
|
|
@ -6,6 +6,6 @@
|
|||
notifempty
|
||||
sharedscripts
|
||||
postrotate
|
||||
systemctl kill --signal=SIGUSR1 airtime-liquidsoap >/dev/null 2>&1 || true
|
||||
systemctl kill --signal=SIGUSR1 libretime-liquidsoap >/dev/null 2>&1 || true
|
||||
endscript
|
||||
}
|
|
@ -193,7 +193,7 @@ class PypoFetch(Thread):
|
|||
|
||||
self.logger.info("Restarting Liquidsoap")
|
||||
subprocess.call(
|
||||
"kill -9 `pidof airtime-liquidsoap`", shell=True, close_fds=True
|
||||
"kill -9 `pidof libretime-liquidsoap`", shell=True, close_fds=True
|
||||
)
|
||||
|
||||
# Wait here and poll Liquidsoap until it has started up
|
||||
|
|
|
@ -8,7 +8,7 @@ here = Path(__file__).parent
|
|||
chdir(here)
|
||||
|
||||
setup(
|
||||
name="airtime-playout",
|
||||
name="libretime-playout",
|
||||
version="1.0",
|
||||
description="LibreTime Playout",
|
||||
author="LibreTime Contributors",
|
||||
|
@ -25,13 +25,13 @@ setup(
|
|||
],
|
||||
package_data={"": ["**/*.liq", "*.cfg", "*.types"]},
|
||||
scripts=[
|
||||
"bin/airtime-playout",
|
||||
"bin/airtime-liquidsoap",
|
||||
"bin/pyponotify",
|
||||
"bin/libretime-playout",
|
||||
"bin/libretime-liquidsoap",
|
||||
"bin/libretime-playout-notify",
|
||||
],
|
||||
python_requires=">=3.6",
|
||||
install_requires=[
|
||||
f"api_clients @ file://localhost/{here.parent}/api_clients#egg=api_clients",
|
||||
f"libretime-api-client @ file://localhost/{here.parent}/api_clients#egg=libretime-api-client",
|
||||
"amqplib",
|
||||
"configobj",
|
||||
"defusedxml",
|
||||
|
|
|
@ -49,7 +49,7 @@ echo -e "The following files, directories, and services will be removed:\n"
|
|||
for i in ${FILES[*]}; do
|
||||
echo "$i"
|
||||
done
|
||||
echo "pip3 airtime-playout"
|
||||
echo "pip3 libretime-playout"
|
||||
|
||||
echo -e "\nIf your web root is not listed, you will need to manually remove it."
|
||||
|
||||
|
@ -87,6 +87,6 @@ if [[ $IN == "y" || $IN == "Y" ]]; then
|
|||
dropLibreTimeDatabase
|
||||
fi
|
||||
|
||||
pip3 uninstall -y airtime-playout airtime-media-monitor airtime-analyzer
|
||||
pip3 uninstall -y libretime-playout airtime-media-monitor airtime-analyzer
|
||||
service apache2 restart
|
||||
echo "...Done"
|
||||
|
|
|
@ -30,9 +30,9 @@ def find_liquidsoap_binary():
|
|||
the location of this binary.
|
||||
"""
|
||||
|
||||
rv = subprocess.call("which airtime-liquidsoap > /dev/null", shell=True)
|
||||
rv = subprocess.call("which libretime-liquidsoap > /dev/null", shell=True)
|
||||
if rv == 0:
|
||||
return "airtime-liquidsoap"
|
||||
return "libretime-liquidsoap"
|
||||
|
||||
return None
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ def printUsage():
|
|||
|
||||
def find_liquidsoap_binary():
|
||||
"""
|
||||
With libretime 3.0 we are no longer depending upon the airtime-liquidsoap binary
|
||||
With libretime 3.0 we are no longer depending upon the libretime-liquidsoap binary
|
||||
but use a generic install of liquidsoap. This takes care of checking if it is on the
|
||||
path and will lead to an error otherwise.
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue