feat(installer): remove allow-restart flag (#1970)

Services management should be handled by the admin. You can use the following command `systemctl restart  libretime.target`
This commit is contained in:
Jonas L 2022-07-17 23:58:51 +02:00 committed by GitHub
parent 96af028daa
commit c4bccf16f9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 26 deletions

3
Vagrantfile vendored
View File

@ -80,14 +80,13 @@ Vagrant.configure('2') do |config|
LIBRETIME_RABBITMQ_PASSWORD=libretime \ LIBRETIME_RABBITMQ_PASSWORD=libretime \
bash install \ bash install \
--listen-port 8080 \ --listen-port 8080 \
--allow-restart \
--in-place \ --in-place \
http://192.168.10.100:8080 http://192.168.10.100:8080
libretime-api migrate libretime-api migrate
libretime-api set_icecast_passwords --from-icecast-config libretime-api set_icecast_passwords --from-icecast-config
systemctl start libretime.target systemctl restart libretime.target
SCRIPT SCRIPT
config.vm.provision 'install', type: 'shell', inline: $script config.vm.provision 'install', type: 'shell', inline: $script

View File

@ -152,12 +152,6 @@ The install script will use randomly generated passwords to create the PostgreSQ
::: :::
:::info
By default, the install script will not restart any service for you, this is to prevent unwanted restarts on production environment. To let the install script restart the services, you need to pass the `--allow-restart` flag.
:::
Feel free to run `./install --help` to get more details. Feel free to run `./install --help` to get more details.
#### Using hardware audio output #### Using hardware audio output

28
install
View File

@ -67,7 +67,6 @@ Options:
--user USER, -u USER User used to run LibreTime. --user USER, -u USER User used to run LibreTime.
--listen-port PORT, -p PORT Listen port for LibreTime. --listen-port PORT, -p PORT Listen port for LibreTime.
--allow-restart, -r Allow the installer to restart LibreTime services.
--in-place, -i Install LibreTime in place. --in-place, -i Install LibreTime in place.
--no-setup-icecast Do not setup Icecast. --no-setup-icecast Do not setup Icecast.
@ -104,9 +103,6 @@ LIBRETIME_LISTEN_PORT=${LIBRETIME_LISTEN_PORT:-"80"}
# > Public URL for LibreTime. # > Public URL for LibreTime.
LIBRETIME_PUBLIC_URL=${LIBRETIME_PUBLIC_URL:-} LIBRETIME_PUBLIC_URL=${LIBRETIME_PUBLIC_URL:-}
# > Allow the installer to restart LibreTime services. We don't want to restart the
# > services by default to prevent uncontrolled downtime.
LIBRETIME_ALLOW_RESTART=${LIBRETIME_ALLOW_RESTART:-false}
# > Install LibreTime in editable mode. # > Install LibreTime in editable mode.
# > Will keep working files in the project directory. # > Will keep working files in the project directory.
LIBRETIME_INSTALL_IN_PLACE=${LIBRETIME_INSTALL_IN_PLACE:-false} LIBRETIME_INSTALL_IN_PLACE=${LIBRETIME_INSTALL_IN_PLACE:-false}
@ -130,10 +126,6 @@ while [[ $# -gt 0 ]]; do
LIBRETIME_LISTEN_PORT=$2 LIBRETIME_LISTEN_PORT=$2
shift 2 shift 2
;; ;;
--allow-restart | -r)
LIBRETIME_ALLOW_RESTART=true
shift 1
;;
--in-place | -i) --in-place | -i)
LIBRETIME_INSTALL_IN_PLACE=true LIBRETIME_INSTALL_IN_PLACE=true
shift 1 shift 1
@ -289,10 +281,6 @@ install_service() {
# service_restart_if_active <name> # service_restart_if_active <name>
service_restart_if_active() { service_restart_if_active() {
if ! $LIBRETIME_ALLOW_RESTART && [[ "$1" =~ libretime ]]; then
return
fi
if systemctl is-active "$1" > /dev/null; then if systemctl is-active "$1" > /dev/null; then
info "restarting $1 service" info "restarting $1 service"
systemctl restart "$1" systemctl restart "$1"
@ -710,12 +698,6 @@ systemctl daemon-reload
service_restart_if_active "php$PHP_VERSION-fpm" service_restart_if_active "php$PHP_VERSION-fpm"
service_restart_if_active "nginx" service_restart_if_active "nginx"
service_restart_if_active "libretime-api"
service_restart_if_active "libretime-celery"
service_restart_if_active "libretime-analyzer"
service_restart_if_active "libretime-playout"
service_restart_if_active "libretime-liquidsoap"
# Instructions # Instructions
######################################################################################## ########################################################################################
@ -742,5 +724,15 @@ Finally, start LibreTime using the following command:
${cyan}\ ${cyan}\
$ sudo systemctl start libretime.target $ sudo systemctl start libretime.target
${reset}"
else
printf "
${yellow}\
You can restart LibreTime using the following command:
${cyan}\
$ sudo systemctl restart libretime.target
${reset}" ${reset}"
fi fi