Merge pull request #1023 from paddatrapper/systemd-units

Rename all systemd, sysvinit and upstart files to libretime
This commit is contained in:
Robb 2020-05-17 09:01:00 -04:00 committed by GitHub
commit ebb6b59755
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 123 additions and 94 deletions

View File

@ -165,19 +165,19 @@ $result = $r1 && $r2;
</tr>
<tr class="<?=$analyzer ? 'success' : 'danger';?>">
<td class="component">
Airtime Analyzer
Media Analyzer
</td>
<td class="description">
Airtime Upload and File Analysis service
<?php echo _("LibreTime media analyzer service") ?>
</td>
<td class="solution <?php if ($analyzer) {echo 'check';?>">
<?php
} else {
?>">
Check that the airtime_analyzer service is installed correctly in <code>/etc/init.d</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime_analyzer</code><br/>
If not, try running <code>sudo service airtime_analyzer start</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 ") ?>
<br/><code>systemctl status libretime-analyzer</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-analyzer</code>
<?php
}
?>
@ -188,16 +188,16 @@ $result = $r1 && $r2;
Pypo
</td>
<td class="description">
Airtime playout service
<?php echo _("LibreTime playout service") ?>
</td>
<td class="solution <?php if ($pypo) {echo 'check';?>">
<?php
} else {
?>">
Check that the airtime-playout service is installed correctly in <code>/etc/init.d</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-playout</code><br/>
If not, try running <code>sudo service airtime-playout restart</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 ") ?>
<br/><code>systemctl status libretime-playout</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-playout</code>
<?php
}
?>
@ -208,16 +208,16 @@ $result = $r1 && $r2;
Liquidsoap
</td>
<td class="description">
Airtime liquidsoap service
<?php echo _("LibreTime liquidsoap service") ?>
</td>
<td class="solution <?php if ($liquidsoap) {echo 'check';?>">
<td class="solution <?php if ($liquidsoap) {echo 'check';?>" >
<?php
} else {
?>">
Check that the airtime-liquidsoap service is installed correctly in <code>/etc/init.d</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-liquidsoap</code><br/>
If not, try running <code>sudo service airtime-liquidsoap restart</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 ") ?>
<br/><code>systemctl status libretime-liquidsoap</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-liquidsoap</code>
<?php
}
?>
@ -228,16 +228,16 @@ $result = $r1 && $r2;
Celery
</td>
<td class="description">
Airtime Celery Task service
<?php echo _("LibreTime Celery Task service") ?>
</td>
<td class="solution <?php if ($celery) {echo 'check';?>">
<td class="solution <?php if ($celery) {echo 'check';?>" >
<?php
} else {
?>">
Check that the airtime-celery service is installed correctly in <code>/etc/init.d</code>,
and ensure that it's running with
<br/><code>initctl list | grep airtime-celery</code><br/>
If not, try running <code>sudo service airtime-celery restart</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 ") ?>
<br/><code>systemctl status libretime-celery</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-celery</code>
<?php
}
?>

View File

@ -44,7 +44,7 @@
<?php
} else {
?>">
Try running <code>sudo apt-get install php5-pgsql</code>
Try running <code>sudo apt-get install php7-pgsql</code>
<?php
}
?>
@ -101,10 +101,10 @@
<?php
} 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 ") ?>
<br/><code>initctl list | grep airtime_analyzer</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo service airtime_analyzer start</code>
<br/><code>systemctl status libretime-analyzer</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-analyzer</code>
<?php
}
?>
@ -121,10 +121,10 @@
<?php
} 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 ") ?>
<br/><code>initctl list | grep airtime-playout</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo service airtime-playout restart</code>
<br/><code>systemctl status libretime-playout</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-playout</code>
<?php
}
?>
@ -141,17 +141,17 @@
<?php
} 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 ") ?>
<br/><code>initctl list | grep airtime-liquidsoap</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo service airtime-liquidsoap restart</code>
<br/><code>systemctl status libretime-liquidsoap</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-liquidsoap</code>
<?php
}
?>
</td>
</tr>
<tr>
<td class="component" align="center">
<td class="component">
Celery
</td>
<td class="description">
@ -161,10 +161,10 @@
<?php
} 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 ") ?>
<br/><code>initctl list | grep airtime-celery</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo service airtime-celery restart</code>
<br/><code>systemctl status libretime-celery</code><br/>
<?php echo _("If not, try ") ?><br/><code>sudo systemctl restart libretime-celery</code>
<?php
}
?>

View File

@ -2,18 +2,18 @@
?>
<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>
<p>
Looks like you're almost done! As a final step, please run the following commands from the terminal:
</p>
<pre style="text-align: left">sudo service airtime-playout start
sudo service airtime-liquidsoap start
sudo service airtime_analyzer start
sudo service airtime-celery start</pre>
<pre style="text-align: left">sudo systemctl start libretime-playout
sudo systemctl start libretime-liquidsoap
sudo systemctl start libretime-analyzer
sudo systemctl start libretime-celery</pre>
<p>
Click "Done!" to bring up the Airtime configuration checklist; if your configuration is all green,
you're ready to get started with your personal Airtime station!
Click "Done!" to bring up the Libretime configuration checklist; if your configuration is all green,
you're ready to get started with your personal Libretime station!
</p>
<p>
If you need to re-run the web installer, just remove <code>/etc/airtime/airtime.conf</code>.

View File

@ -5211,24 +5211,24 @@ msgid "LibreTime Celery Task service"
msgstr "Служба Celery Task LibreTime"
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:104
msgid "Check that the airtime_analyzer service is installed correctly in "
msgstr "Проверьте, что служба airtime_analyzer правильно установлена в "
msgid "Check that the libretime-analyzer service is installed correctly in "
msgstr "Проверьте, что служба libretime-analyzer правильно установлена в "
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:124
msgid "Check that the airtime-playout service is installed correctly in "
msgstr "Проверьте, что служба airtime-playout правильно установлена в "
msgid "Check that the libretime-playout service is installed correctly in "
msgstr "Проверьте, что служба libretime-playout правильно установлена в "
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:144
msgid "Check that the airtime-liquidsoap service is installed correctly in "
msgstr "Проверьте, что служба airtime-liquidsoap правильно установлена в "
msgid "Check that the libretime-liquidsoap service is installed correctly in "
msgstr "Проверьте, что служба libretime-liquidsoap правильно установлена в "
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:164
msgid "Check that the airtime-celery service is installed correctly in "
msgstr "Проверьте, что служба airtime-celery правильно установлена в "
msgid "Check that the libretime-celery service is installed correctly in "
msgstr "Проверьте, что служба libretime-celery правильно установлена в "
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:158
msgid " If not, try <br/><code>sudo service airtime-celery restart</code>"
msgstr " Если нет - попробуйте запустить <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 libretime-celery restart</code>"
#: airtime_mvc\application\views\scripts\systemstatus\index.phtml:164
msgid " and ensure that it's running with "

View File

@ -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
used by the various components of LibreTime, run the following commands
sudo systemctl restart airtime-liquidsoap
sudo systemctl restart airtime-playout
sudo systemctl restart airtime-celery
sudo systemctl restart airtime_analyzer
sudo systemctl restart libretime-liquidsoap
sudo systemctl restart libretime-playout
sudo systemctl restart libretime-celery
sudo systemctl restart libretime-analyzer
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:
sudo systemctl restart airtime-playout
sudo systemctl restart libretime-playout
for the changes to take effect.

View File

@ -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:
sudo systemctl start|stop|restart|status airtime-liquidsoap
sudo systemctl start|stop|restart|status airtime-playout
sudo systemctl start|stop|restart|status airtime-celery
sudo systemctl start|stop|restart|status airtime_analyzer
sudo systemctl start|stop|restart|status libretime-liquidsoap
sudo systemctl start|stop|restart|status libretime-playout
sudo systemctl start|stop|restart|status libretime-celery
sudo systemctl start|stop|restart|status libretime-analyzer
sudo systemctl start|stop|restart|status apache2
sudo systemctl start|stop|restart|status rabbitmq-server
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
---------

65
install
View File

@ -180,14 +180,29 @@ function systemInitInstall() {
local source_base_path=""
local source_path=""
local target_path=""
local alt_path=""
local source_config_path=""
local target_config_path=""
local python_source_path="${SCRIPT_DIR-$PWD}/python_apps"
verbose "\n * Installing service $service_name ..."
if $has_systemd_init; then
# TODO: move .service files under python_apps/.../install/systemd
source_path="${SCRIPT_DIR-$PWD}/installer/systemd/${service_name}.service"
target_path="/etc/systemd/system/${service_name}.service"
case "$service_name" in
libretime-analyzer)
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
echo "$0:${FUNCNAME}(): ERROR: service \"$service_name\" with source path \"$source_path\" does not exist!" >&2
exit 1
@ -198,6 +213,16 @@ function systemInitInstall() {
loudCmd "systemctl disable ${service_name}.service"
loudCmd "systemctl stop ${service_name}.service"
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 [[ -z $user ]]; then
loudCmd "cp $source_path $target_path"
@ -205,6 +230,11 @@ function systemInitInstall() {
sed -e "s/User=.*/User=${user}/" \
-e "s/Group=.*/Group=${user}/" $source_path > $target_path
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
chown root:root $target_path
verbose "Service ${service_name} installed into ${target_path}"
@ -213,17 +243,17 @@ function systemInitInstall() {
verbose "Service ${service_name} enabled and started"
elif $has_upstart_init; then
case "$service_name" in
airtime_analyzer)
source_path="${python_source_path}/${service_name}/install/upstart/${service_name}.conf"
libretime-analyzer)
source_path="${python_source_path}/airtime_analyzer/install/upstart/${service_name}.conf"
target_path="/etc/init/${service_name}.conf"
user=${user:-$web_user}
;;
airtime-celery)
source_path="${python_source_path}/${service_name}/install/upstart/${service_name}.conf"
libretime-celery)
source_path="${python_source_path}/airtime-celery/install/upstart/${service_name}.conf"
target_path="/etc/init/${service_name}.conf"
user=""
;;
airtime-liquidsoap|airtime-playout)
libretime-liquidsoap|libretime-playout)
source_path="${python_source_path}/pypo/install/upstart/${service_name}.conf.template"
target_path="/etc/init/${service_name}.conf"
user=${user:-$web_user}
@ -251,19 +281,19 @@ function systemInitInstall() {
loudCmd "initctl check-config $service_name"
elif $has_systemv_init; then
case "$service_name" in
airtime_analyzer)
source_path="${python_source_path}/${service_name}/install/sysvinit/${service_name}"
libretime-analyzer)
source_path="${python_source_path}/airtime_analyzer/install/sysvinit/${service_name}"
target_path="/etc/init.d/${service_name}"
user=${user:-$web_user}
;;
airtime-celery)
source_path="${python_source_path}/${service_name}/install/initd/${service_name}"
libretime-celery)
source_path="${python_source_path}/airtime-celery/install/sysvinit/${service_name}"
target_path="/etc/init.d/${service_name}"
source_config_path="${python_source_path}/${service_name}/install/conf/${service_name}"
target_config_path="/etc/default/${service_name}"
user=""
;;
airtime-liquidsoap|airtime-playout)
libretime-liquidsoap|libretime-playout)
source_path="${python_source_path}/pypo/install/sysvinit/${service_name}"
target_path="/etc/init.d/${service_name}"
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/airtime*
rm -f /etc/default/airtime-celery
rm -f /etc/systemd/system/airtime*
if [ "$apache" = "t" ]; then
# 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 "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/"
systemInitInstall airtime-liquidsoap $web_user
systemInitInstall airtime-playout $web_user
systemInitInstall libretime-liquidsoap $web_user
systemInitInstall libretime-playout $web_user
verbose "...Done"
verbose "\n * Installing airtime-celery..."
@ -974,12 +1003,12 @@ loudCmd "usermod -G ${web_user} -a celery"
# CentOS installs celery in /usr/bin which differs from other distros. Make
# 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
systemInitInstall airtime-celery
systemInitInstall libretime-celery
verbose "...Done"
verbose "\n * Installing airtime_analyzer..."
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 "\n * Setting permissions on /var/log/airtime..."

View File

@ -3,8 +3,8 @@ Description=LibreTime Media Analyzer Service
[Service]
ExecStart=/usr/bin/airtime_analyzer
User=airtime-analyzer
Group=airtime-analyzer
User=libretime-analyzer
Group=libretime-analyzer
Restart=always
[Install]

View File

@ -1,5 +1,5 @@
[Unit]
Description=Airtime Liquidsoap Service
Description=Libretime Liquidsoap Service
[Service]
ExecStart=/usr/bin/airtime-liquidsoap

View File

@ -1,5 +1,5 @@
[Unit]
Description=Airtime Playout Service
Description=Libretime Playout Service
After=network-online.target
[Service]