Merge pull request #1023 from paddatrapper/systemd-units
Rename all systemd, sysvinit and upstart files to libretime
This commit is contained in:
commit
ebb6b59755
|
@ -165,19 +165,19 @@ $result = $r1 && $r2;
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="<?=$analyzer ? 'success' : 'danger';?>">
|
<tr class="<?=$analyzer ? 'success' : 'danger';?>">
|
||||||
<td class="component">
|
<td class="component">
|
||||||
Airtime Analyzer
|
Media Analyzer
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Airtime Upload and File Analysis service
|
<?php echo _("LibreTime media analyzer service") ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="solution <?php if ($analyzer) {echo 'check';?>">
|
<td class="solution <?php if ($analyzer) {echo 'check';?>">
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
Check that the airtime_analyzer service is installed correctly in <code>/etc/init.d</code>,
|
<?php echo _("Check that the libretime-analyzer service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
and ensure that it's running with
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime_analyzer</code><br/>
|
<br/><code>systemctl status libretime-analyzer</code><br/>
|
||||||
If not, try running <code>sudo service airtime_analyzer start</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-analyzer</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -188,16 +188,16 @@ $result = $r1 && $r2;
|
||||||
Pypo
|
Pypo
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Airtime playout service
|
<?php echo _("LibreTime playout service") ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="solution <?php if ($pypo) {echo 'check';?>">
|
<td class="solution <?php if ($pypo) {echo 'check';?>">
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
Check that the airtime-playout service is installed correctly in <code>/etc/init.d</code>,
|
<?php echo _("Check that the libretime-playout service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
and ensure that it's running with
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime-playout</code><br/>
|
<br/><code>systemctl status libretime-playout</code><br/>
|
||||||
If not, try running <code>sudo service airtime-playout restart</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-playout</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -208,16 +208,16 @@ $result = $r1 && $r2;
|
||||||
Liquidsoap
|
Liquidsoap
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Airtime liquidsoap service
|
<?php echo _("LibreTime liquidsoap service") ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="solution <?php if ($liquidsoap) {echo 'check';?>">
|
<td class="solution <?php if ($liquidsoap) {echo 'check';?>" >
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init.d</code>,
|
<?php echo _("Check that the libretime-liquidsoap service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
and ensure that it's running with
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime-liquidsoap</code><br/>
|
<br/><code>systemctl status libretime-liquidsoap</code><br/>
|
||||||
If not, try running <code>sudo service airtime-liquidsoap restart</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-liquidsoap</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -228,16 +228,16 @@ $result = $r1 && $r2;
|
||||||
Celery
|
Celery
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
Airtime Celery Task service
|
<?php echo _("LibreTime Celery Task service") ?>
|
||||||
</td>
|
</td>
|
||||||
<td class="solution <?php if ($celery) {echo 'check';?>">
|
<td class="solution <?php if ($celery) {echo 'check';?>" >
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
Check that the airtime-celery service is installed correctly in <code>/etc/init.d</code>,
|
<?php echo _("Check that the libretime-celery service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
and ensure that it's running with
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime-celery</code><br/>
|
<br/><code>systemctl status libretime-celery</code><br/>
|
||||||
If not, try running <code>sudo service airtime-celery restart</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-celery</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
Try running <code>sudo apt-get install php5-pgsql</code>
|
Try running <code>sudo apt-get install php7-pgsql</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -101,10 +101,10 @@
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
<?php echo _("Check that the airtime_analyzer service is installed correctly in ") ?><code>/etc/init</code>,
|
<?php echo _("Check that the libretime-analyzer service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
<?php echo _(" and ensure that it's running with ") ?>
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime_analyzer</code><br/>
|
<br/><code>systemctl status libretime-analyzer</code><br/>
|
||||||
<?php echo _("If not, try ") ?><br/><code>sudo service airtime_analyzer start</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-analyzer</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -121,10 +121,10 @@
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
<?php echo _("Check that the airtime-playout service is installed correctly in ") ?><code>/etc/init</code>,
|
<?php echo _("Check that the libretime-playout service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
<?php echo _(" and ensure that it's running with ") ?>
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime-playout</code><br/>
|
<br/><code>systemctl status libretime-playout</code><br/>
|
||||||
<?php echo _("If not, try ") ?><br/><code>sudo service airtime-playout restart</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-playout</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
@ -141,17 +141,17 @@
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
<?php echo _("Check that the airtime-liquidsoap service is installed correctly in ") ?><code>/etc/init</code>,
|
<?php echo _("Check that the libretime-liquidsoap service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
<?php echo _(" and ensure that it's running with ") ?>
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime-liquidsoap</code><br/>
|
<br/><code>systemctl status libretime-liquidsoap</code><br/>
|
||||||
<?php echo _("If not, try ") ?><br/><code>sudo service airtime-liquidsoap restart</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-liquidsoap</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="component" align="center">
|
<td class="component">
|
||||||
Celery
|
Celery
|
||||||
</td>
|
</td>
|
||||||
<td class="description">
|
<td class="description">
|
||||||
|
@ -161,10 +161,10 @@
|
||||||
<?php
|
<?php
|
||||||
} else {
|
} else {
|
||||||
?>">
|
?>">
|
||||||
<?php echo _("Check that the airtime-celery service is installed correctly in ") ?><code>/etc/init</code>,
|
<?php echo _("Check that the libretime-celery service is installed correctly in ") ?><code>/etc/systemd/system/</code>,
|
||||||
<?php echo _(" and ensure that it's running with ") ?>
|
<?php echo _(" and ensure that it's running with ") ?>
|
||||||
<br/><code>initctl list | grep airtime-celery</code><br/>
|
<br/><code>systemctl status libretime-celery</code><br/>
|
||||||
<?php echo _("If not, try ") ?><br/><code>sudo service airtime-celery restart</code>
|
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-celery</code>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -2,18 +2,18 @@
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<form action="#" role="form" id="finishSettingsForm">
|
<form action="#" role="form" id="finishSettingsForm">
|
||||||
<h3 class="form-title">Manual Step: Start Airtime Services</h3>
|
<h3 class="form-title">Manual Step: Start Libretime Services</h3>
|
||||||
<span id="helpBlock" class="help-block help-message"></span>
|
<span id="helpBlock" class="help-block help-message"></span>
|
||||||
<p>
|
<p>
|
||||||
Looks like you're almost done! As a final step, please run the following commands from the terminal:
|
Looks like you're almost done! As a final step, please run the following commands from the terminal:
|
||||||
</p>
|
</p>
|
||||||
<pre style="text-align: left">sudo service airtime-playout start
|
<pre style="text-align: left">sudo systemctl start libretime-playout
|
||||||
sudo service airtime-liquidsoap start
|
sudo systemctl start libretime-liquidsoap
|
||||||
sudo service airtime_analyzer start
|
sudo systemctl start libretime-analyzer
|
||||||
sudo service airtime-celery start</pre>
|
sudo systemctl start libretime-celery</pre>
|
||||||
<p>
|
<p>
|
||||||
Click "Done!" to bring up the Airtime configuration checklist; if your configuration is all green,
|
Click "Done!" to bring up the Libretime configuration checklist; if your configuration is all green,
|
||||||
you're ready to get started with your personal Airtime station!
|
you're ready to get started with your personal Libretime station!
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<p>
|
||||||
If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>.
|
If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>.
|
||||||
|
@ -28,4 +28,4 @@ sudo service airtime-celery start</pre>
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
window.location.assign("/?config");
|
window.location.assign("/?config");
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
|
@ -45,7 +45,7 @@ function checkDatabaseDependencies() {
|
||||||
/**
|
/**
|
||||||
* Check that all external services are configured correctly and return an associative
|
* Check that all external services are configured correctly and return an associative
|
||||||
* array with the results
|
* array with the results
|
||||||
*
|
*
|
||||||
* @return array associative array of external service check results
|
* @return array associative array of external service check results
|
||||||
*/
|
*/
|
||||||
function checkExternalServices() {
|
function checkExternalServices() {
|
||||||
|
@ -88,7 +88,7 @@ function configureDatabase() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check that we can connect to RabbitMQ
|
* Check that we can connect to RabbitMQ
|
||||||
*
|
*
|
||||||
* @return true if the RabbitMQ connection can be established
|
* @return true if the RabbitMQ connection can be established
|
||||||
*/
|
*/
|
||||||
function checkRMQConnection() {
|
function checkRMQConnection() {
|
||||||
|
@ -109,7 +109,7 @@ function checkRMQConnection() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if airtime-analyzer is currently running
|
* Check if airtime-analyzer is currently running
|
||||||
*
|
*
|
||||||
* @return boolean true if airtime-analyzer is running
|
* @return boolean true if airtime-analyzer is running
|
||||||
*/
|
*/
|
||||||
function checkAnalyzerService() {
|
function checkAnalyzerService() {
|
||||||
|
@ -122,7 +122,7 @@ function checkAnalyzerService() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if airtime-playout is currently running
|
* Check if airtime-playout is currently running
|
||||||
*
|
*
|
||||||
* @return boolean true if airtime-playout is running
|
* @return boolean true if airtime-playout is running
|
||||||
*/
|
*/
|
||||||
function checkPlayoutService() {
|
function checkPlayoutService() {
|
||||||
|
@ -135,7 +135,7 @@ function checkPlayoutService() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if airtime-liquidsoap is currently running
|
* Check if airtime-liquidsoap is currently running
|
||||||
*
|
*
|
||||||
* @return boolean true if airtime-liquidsoap is running
|
* @return boolean true if airtime-liquidsoap is running
|
||||||
*/
|
*/
|
||||||
function checkLiquidsoapService() {
|
function checkLiquidsoapService() {
|
||||||
|
@ -148,7 +148,7 @@ function checkLiquidsoapService() {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if airtime-celery is currently running
|
* Check if airtime-celery is currently running
|
||||||
*
|
*
|
||||||
* @return boolean true if airtime-celery is running
|
* @return boolean true if airtime-celery is running
|
||||||
*/
|
*/
|
||||||
function checkCeleryService() {
|
function checkCeleryService() {
|
||||||
|
|
|
@ -5211,24 +5211,24 @@ msgid "LibreTime Celery Task service"
|
||||||
msgstr "Служба Celery Task LibreTime"
|
msgstr "Служба Celery Task LibreTime"
|
||||||
|
|
||||||
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:104
|
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:104
|
||||||
msgid "Check that the airtime_analyzer service is installed correctly in "
|
msgid "Check that the libretime-analyzer service is installed correctly in "
|
||||||
msgstr "Проверьте, что служба airtime_analyzer правильно установлена в "
|
msgstr "Проверьте, что служба libretime-analyzer правильно установлена в "
|
||||||
|
|
||||||
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:124
|
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:124
|
||||||
msgid "Check that the airtime-playout service is installed correctly in "
|
msgid "Check that the libretime-playout service is installed correctly in "
|
||||||
msgstr "Проверьте, что служба airtime-playout правильно установлена в "
|
msgstr "Проверьте, что служба libretime-playout правильно установлена в "
|
||||||
|
|
||||||
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:144
|
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:144
|
||||||
msgid "Check that the airtime-liquidsoap service is installed correctly in "
|
msgid "Check that the libretime-liquidsoap service is installed correctly in "
|
||||||
msgstr "Проверьте, что служба airtime-liquidsoap правильно установлена в "
|
msgstr "Проверьте, что служба libretime-liquidsoap правильно установлена в "
|
||||||
|
|
||||||
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:164
|
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:164
|
||||||
msgid "Check that the airtime-celery service is installed correctly in "
|
msgid "Check that the libretime-celery service is installed correctly in "
|
||||||
msgstr "Проверьте, что служба airtime-celery правильно установлена в "
|
msgstr "Проверьте, что служба libretime-celery правильно установлена в "
|
||||||
|
|
||||||
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:158
|
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:158
|
||||||
msgid " If not, try <br/><code>sudo service airtime-celery restart</code>"
|
msgid " If not, try <br/><code>sudo service libretime-celery restart</code>"
|
||||||
msgstr " Если нет - попробуйте запустить <br/><code>sudo service airtime-celery restart</code>"
|
msgstr " Если нет - попробуйте запустить <br/><code>sudo service libretime-celery restart</code>"
|
||||||
|
|
||||||
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:164
|
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:164
|
||||||
msgid " and ensure that it's running with "
|
msgid " and ensure that it's running with "
|
||||||
|
|
|
@ -48,10 +48,10 @@ You can also set options for RabbitMQ messaging, the LibreTime server and SoundC
|
||||||
Save and close the file with **Ctrl+O** and **Ctrl+X**. In order to update the configuration
|
Save and close the file with **Ctrl+O** and **Ctrl+X**. In order to update the configuration
|
||||||
used by the various components of LibreTime, run the following commands
|
used by the various components of LibreTime, run the following commands
|
||||||
|
|
||||||
sudo systemctl restart airtime-liquidsoap
|
sudo systemctl restart libretime-liquidsoap
|
||||||
sudo systemctl restart airtime-playout
|
sudo systemctl restart libretime-playout
|
||||||
sudo systemctl restart airtime-celery
|
sudo systemctl restart libretime-celery
|
||||||
sudo systemctl restart airtime_analyzer
|
sudo systemctl restart libretime-analyzer
|
||||||
|
|
||||||
Changing the default PostgreSQL passwords
|
Changing the default PostgreSQL passwords
|
||||||
----------------------------------------
|
----------------------------------------
|
||||||
|
@ -101,7 +101,7 @@ Playout and recorder settings
|
||||||
|
|
||||||
Settings for pypo, the playout and recording engine used by LibreTime, are found in the file */etc/airtime/airtime.conf*. After making changes to this file, you will have to issue the command:
|
Settings for pypo, the playout and recording engine used by LibreTime, are found in the file */etc/airtime/airtime.conf*. After making changes to this file, you will have to issue the command:
|
||||||
|
|
||||||
sudo systemctl restart airtime-playout
|
sudo systemctl restart libretime-playout
|
||||||
|
|
||||||
for the changes to take effect.
|
for the changes to take effect.
|
||||||
|
|
||||||
|
|
|
@ -2,16 +2,16 @@
|
||||||
|
|
||||||
If your Airtime server is not working as expected, individual components of the system can be started, stopped, restarted or checked in the server console using the **systemctl** command:
|
If your Airtime server is not working as expected, individual components of the system can be started, stopped, restarted or checked in the server console using the **systemctl** command:
|
||||||
|
|
||||||
sudo systemctl start|stop|restart|status airtime-liquidsoap
|
sudo systemctl start|stop|restart|status libretime-liquidsoap
|
||||||
sudo systemctl start|stop|restart|status airtime-playout
|
sudo systemctl start|stop|restart|status libretime-playout
|
||||||
sudo systemctl start|stop|restart|status airtime-celery
|
sudo systemctl start|stop|restart|status libretime-celery
|
||||||
sudo systemctl start|stop|restart|status airtime_analyzer
|
sudo systemctl start|stop|restart|status libretime-analyzer
|
||||||
sudo systemctl start|stop|restart|status apache2
|
sudo systemctl start|stop|restart|status apache2
|
||||||
sudo systemctl start|stop|restart|status rabbitmq-server
|
sudo systemctl start|stop|restart|status rabbitmq-server
|
||||||
|
|
||||||
For example, to restart the Airtime playout engine, you could enter the command:
|
For example, to restart the Airtime playout engine, you could enter the command:
|
||||||
|
|
||||||
sudo systemctl restart airtime-analyzer
|
sudo systemctl restart libretime-playout
|
||||||
|
|
||||||
Log files
|
Log files
|
||||||
---------
|
---------
|
||||||
|
|
67
install
67
install
|
@ -180,14 +180,29 @@ function systemInitInstall() {
|
||||||
local source_base_path=""
|
local source_base_path=""
|
||||||
local source_path=""
|
local source_path=""
|
||||||
local target_path=""
|
local target_path=""
|
||||||
|
local alt_path=""
|
||||||
local source_config_path=""
|
local source_config_path=""
|
||||||
local target_config_path=""
|
local target_config_path=""
|
||||||
local python_source_path="${SCRIPT_DIR-$PWD}/python_apps"
|
local python_source_path="${SCRIPT_DIR-$PWD}/python_apps"
|
||||||
verbose "\n * Installing service $service_name ..."
|
verbose "\n * Installing service $service_name ..."
|
||||||
if $has_systemd_init; then
|
if $has_systemd_init; then
|
||||||
# TODO: move .service files under python_apps/.../install/systemd
|
case "$service_name" in
|
||||||
source_path="${SCRIPT_DIR-$PWD}/installer/systemd/${service_name}.service"
|
libretime-analyzer)
|
||||||
target_path="/etc/systemd/system/${service_name}.service"
|
source_path="${python_source_path}/airtime_analyzer/install/systemd/${service_name}.service"
|
||||||
|
target_path="/etc/systemd/system/${service_name}.service"
|
||||||
|
alt_path=$(echo $target_path | sed 's/libretime-/airtime_/')
|
||||||
|
;;
|
||||||
|
libretime-celery)
|
||||||
|
source_path="${python_source_path}/airtime-celery/install/systemd/${service_name}.service"
|
||||||
|
target_path="/etc/systemd/system/${service_name}.service"
|
||||||
|
alt_path=$(echo $target_path | sed 's/libretime-/airtime-/')
|
||||||
|
;;
|
||||||
|
libretime-liquidsoap|libretime-playout)
|
||||||
|
source_path="${python_source_path}/pypo/install/systemd/${service_name}.service"
|
||||||
|
target_path="/etc/systemd/system/${service_name}.service"
|
||||||
|
alt_path=$(echo $target_path | sed 's/libretime-/airtime-/')
|
||||||
|
;;
|
||||||
|
esac
|
||||||
if [[ ! -e $source_path ]]; then
|
if [[ ! -e $source_path ]]; then
|
||||||
echo "$0:${FUNCNAME}(): ERROR: service \"$service_name\" with source path \"$source_path\" does not exist!" >&2
|
echo "$0:${FUNCNAME}(): ERROR: service \"$service_name\" with source path \"$source_path\" does not exist!" >&2
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -198,6 +213,16 @@ function systemInitInstall() {
|
||||||
loudCmd "systemctl disable ${service_name}.service"
|
loudCmd "systemctl disable ${service_name}.service"
|
||||||
loudCmd "systemctl stop ${service_name}.service"
|
loudCmd "systemctl stop ${service_name}.service"
|
||||||
fi
|
fi
|
||||||
|
local old_style_unit_exists="f"
|
||||||
|
# Migrate old style airtime unit exist if it exists
|
||||||
|
if [[ -e $alt_path && ! -L $alt_path ]]; then
|
||||||
|
local old_service=$(echo $service_name | sed 's/libretime/airtime/' | sed 's/-analyzer/_analyzer/')
|
||||||
|
verbose "Old service $old_service already exists - migrating."
|
||||||
|
loudCmd "systemctl disable ${old_service}.service"
|
||||||
|
loudCmd "systemctl stop ${old_service}.service"
|
||||||
|
loudCmd "rm $alt_path"
|
||||||
|
old_style_unit_exists="t"
|
||||||
|
fi
|
||||||
# If no user defined, then just copy, otherwise filter
|
# If no user defined, then just copy, otherwise filter
|
||||||
if [[ -z $user ]]; then
|
if [[ -z $user ]]; then
|
||||||
loudCmd "cp $source_path $target_path"
|
loudCmd "cp $source_path $target_path"
|
||||||
|
@ -205,6 +230,11 @@ function systemInitInstall() {
|
||||||
sed -e "s/User=.*/User=${user}/" \
|
sed -e "s/User=.*/User=${user}/" \
|
||||||
-e "s/Group=.*/Group=${user}/" $source_path > $target_path
|
-e "s/Group=.*/Group=${user}/" $source_path > $target_path
|
||||||
fi
|
fi
|
||||||
|
if [[ $old_style_unit_exists == "t" ]]; then
|
||||||
|
verbose "Maintaining compatibility with old systemd unit names"
|
||||||
|
# Alias to old Airtime names
|
||||||
|
loudCmd "ln -s $source_path $alt_path"
|
||||||
|
fi
|
||||||
chmod 0644 $target_path
|
chmod 0644 $target_path
|
||||||
chown root:root $target_path
|
chown root:root $target_path
|
||||||
verbose "Service ${service_name} installed into ${target_path}"
|
verbose "Service ${service_name} installed into ${target_path}"
|
||||||
|
@ -213,17 +243,17 @@ function systemInitInstall() {
|
||||||
verbose "Service ${service_name} enabled and started"
|
verbose "Service ${service_name} enabled and started"
|
||||||
elif $has_upstart_init; then
|
elif $has_upstart_init; then
|
||||||
case "$service_name" in
|
case "$service_name" in
|
||||||
airtime_analyzer)
|
libretime-analyzer)
|
||||||
source_path="${python_source_path}/${service_name}/install/upstart/${service_name}.conf"
|
source_path="${python_source_path}/airtime_analyzer/install/upstart/${service_name}.conf"
|
||||||
target_path="/etc/init/${service_name}.conf"
|
target_path="/etc/init/${service_name}.conf"
|
||||||
user=${user:-$web_user}
|
user=${user:-$web_user}
|
||||||
;;
|
;;
|
||||||
airtime-celery)
|
libretime-celery)
|
||||||
source_path="${python_source_path}/${service_name}/install/upstart/${service_name}.conf"
|
source_path="${python_source_path}/airtime-celery/install/upstart/${service_name}.conf"
|
||||||
target_path="/etc/init/${service_name}.conf"
|
target_path="/etc/init/${service_name}.conf"
|
||||||
user=""
|
user=""
|
||||||
;;
|
;;
|
||||||
airtime-liquidsoap|airtime-playout)
|
libretime-liquidsoap|libretime-playout)
|
||||||
source_path="${python_source_path}/pypo/install/upstart/${service_name}.conf.template"
|
source_path="${python_source_path}/pypo/install/upstart/${service_name}.conf.template"
|
||||||
target_path="/etc/init/${service_name}.conf"
|
target_path="/etc/init/${service_name}.conf"
|
||||||
user=${user:-$web_user}
|
user=${user:-$web_user}
|
||||||
|
@ -251,19 +281,19 @@ function systemInitInstall() {
|
||||||
loudCmd "initctl check-config $service_name"
|
loudCmd "initctl check-config $service_name"
|
||||||
elif $has_systemv_init; then
|
elif $has_systemv_init; then
|
||||||
case "$service_name" in
|
case "$service_name" in
|
||||||
airtime_analyzer)
|
libretime-analyzer)
|
||||||
source_path="${python_source_path}/${service_name}/install/sysvinit/${service_name}"
|
source_path="${python_source_path}/airtime_analyzer/install/sysvinit/${service_name}"
|
||||||
target_path="/etc/init.d/${service_name}"
|
target_path="/etc/init.d/${service_name}"
|
||||||
user=${user:-$web_user}
|
user=${user:-$web_user}
|
||||||
;;
|
;;
|
||||||
airtime-celery)
|
libretime-celery)
|
||||||
source_path="${python_source_path}/${service_name}/install/initd/${service_name}"
|
source_path="${python_source_path}/airtime-celery/install/sysvinit/${service_name}"
|
||||||
target_path="/etc/init.d/${service_name}"
|
target_path="/etc/init.d/${service_name}"
|
||||||
source_config_path="${python_source_path}/${service_name}/install/conf/${service_name}"
|
source_config_path="${python_source_path}/${service_name}/install/conf/${service_name}"
|
||||||
target_config_path="/etc/default/${service_name}"
|
target_config_path="/etc/default/${service_name}"
|
||||||
user=""
|
user=""
|
||||||
;;
|
;;
|
||||||
airtime-liquidsoap|airtime-playout)
|
libretime-liquidsoap|libretime-playout)
|
||||||
source_path="${python_source_path}/pypo/install/sysvinit/${service_name}"
|
source_path="${python_source_path}/pypo/install/sysvinit/${service_name}"
|
||||||
target_path="/etc/init.d/${service_name}"
|
target_path="/etc/init.d/${service_name}"
|
||||||
user=${user:-$web_user}
|
user=${user:-$web_user}
|
||||||
|
@ -763,7 +793,6 @@ will be moved to /etc/airtime/airtime.conf.tmp"
|
||||||
rm -f /etc/init.d/airtime*
|
rm -f /etc/init.d/airtime*
|
||||||
rm -f /etc/init/airtime*
|
rm -f /etc/init/airtime*
|
||||||
rm -f /etc/default/airtime-celery
|
rm -f /etc/default/airtime-celery
|
||||||
rm -f /etc/systemd/system/airtime*
|
|
||||||
|
|
||||||
if [ "$apache" = "t" ]; then
|
if [ "$apache" = "t" ]; then
|
||||||
# If the user selects an "in-place" install or passes in a web root,
|
# If the user selects an "in-place" install or passes in a web root,
|
||||||
|
@ -957,8 +986,8 @@ verbose "\n * Installing pypo and liquidsoap..."
|
||||||
loudCmd "python3 ${AIRTIMEROOT}/python_apps/pypo/setup.py install --install-scripts=/usr/bin --no-init-script"
|
loudCmd "python3 ${AIRTIMEROOT}/python_apps/pypo/setup.py install --install-scripts=/usr/bin --no-init-script"
|
||||||
loudCmd "mkdir -p /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
loudCmd "mkdir -p /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
||||||
loudCmd "chown -R ${web_user}:${web_user} /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
loudCmd "chown -R ${web_user}:${web_user} /var/log/airtime/{pypo,pypo-liquidsoap} /var/tmp/airtime/pypo/{cache,files,tmp} /var/tmp/airtime/show-recorder/"
|
||||||
systemInitInstall airtime-liquidsoap $web_user
|
systemInitInstall libretime-liquidsoap $web_user
|
||||||
systemInitInstall airtime-playout $web_user
|
systemInitInstall libretime-playout $web_user
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing airtime-celery..."
|
verbose "\n * Installing airtime-celery..."
|
||||||
|
@ -971,15 +1000,15 @@ else
|
||||||
fi
|
fi
|
||||||
# Add celery to the www-data group
|
# Add celery to the www-data group
|
||||||
loudCmd "usermod -G ${web_user} -a celery"
|
loudCmd "usermod -G ${web_user} -a celery"
|
||||||
# CentOS installs celery in /usr/bin which differs from other distros. Make
|
# CentOS installs celery in /usr/bin which differs from other distros. Make
|
||||||
# available in /usr/local/bin as systemd requires an absolute path.
|
# available in /usr/local/bin as systemd requires an absolute path.
|
||||||
[[ ! -e /usr/local/bin/celery ]] && ln -s /usr/bin/celery /usr/local/bin/celery
|
[[ ! -e /usr/local/bin/celery ]] && ln -s /usr/bin/celery /usr/local/bin/celery
|
||||||
systemInitInstall airtime-celery
|
systemInitInstall libretime-celery
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Installing airtime_analyzer..."
|
verbose "\n * Installing airtime_analyzer..."
|
||||||
loudCmd "python3 ${AIRTIMEROOT}/python_apps/airtime_analyzer/setup.py install --install-scripts=/usr/bin --no-init-script"
|
loudCmd "python3 ${AIRTIMEROOT}/python_apps/airtime_analyzer/setup.py install --install-scripts=/usr/bin --no-init-script"
|
||||||
systemInitInstall airtime_analyzer $web_user
|
systemInitInstall libretime-analyzer $web_user
|
||||||
verbose "...Done"
|
verbose "...Done"
|
||||||
|
|
||||||
verbose "\n * Setting permissions on /var/log/airtime..."
|
verbose "\n * Setting permissions on /var/log/airtime..."
|
||||||
|
|
|
@ -3,8 +3,8 @@ Description=LibreTime Media Analyzer Service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/airtime_analyzer
|
ExecStart=/usr/bin/airtime_analyzer
|
||||||
User=airtime-analyzer
|
User=libretime-analyzer
|
||||||
Group=airtime-analyzer
|
Group=libretime-analyzer
|
||||||
Restart=always
|
Restart=always
|
||||||
|
|
||||||
[Install]
|
[Install]
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Airtime Liquidsoap Service
|
Description=Libretime Liquidsoap Service
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStart=/usr/bin/airtime-liquidsoap
|
ExecStart=/usr/bin/airtime-liquidsoap
|
|
@ -1,5 +1,5 @@
|
||||||
[Unit]
|
[Unit]
|
||||||
Description=Airtime Playout Service
|
Description=Libretime Playout Service
|
||||||
After=network-online.target
|
After=network-online.target
|
||||||
|
|
||||||
[Service]
|
[Service]
|
Loading…
Reference in New Issue