mirror of
https://github.com/YunoHost-Apps/glitchsoc_ynh.git
synced 2024-09-03 19:15:59 +02:00
fix
This commit is contained in:
parent
c4841f187a
commit
3ce283a8d1
1 changed files with 9 additions and 11 deletions
|
@ -111,17 +111,6 @@ if [ -z "$max_remote_emoji_size" ]; then
|
|||
ynh_app_setting_set --app=$app --key=max_remote_emoji_size --value=$max_remote_emoji_size
|
||||
fi
|
||||
|
||||
# Rename the database to match packaging v2 defaults db_name (`$app_production` to `$app`)
|
||||
if [[ $db_name = *'_production' ]]; then
|
||||
ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=systemd --line_match="Stopped"
|
||||
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=systemd --line_match="Stopped"
|
||||
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=systemd --line_match="Stopped"
|
||||
|
||||
ynh_psql_execute_as_root --sql="ALTER DATABASE $db_name RENAME TO $app;"
|
||||
db_name=$app
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
fi
|
||||
|
||||
# If service doesn't exist, create it
|
||||
if [[ -z "$service" ]]; then
|
||||
# Set `service` settings to support `yunohost app shell` command
|
||||
|
@ -137,6 +126,13 @@ ynh_systemd_action --service_name=${app}-web --action="stop" --log_path=/var/log
|
|||
ynh_systemd_action --service_name=${app}-sidekiq --action="stop" --log_path=/var/log/$app/$app-sidekiq.log --line_match="Stopped"
|
||||
ynh_systemd_action --service_name=${app}-streaming --action="stop" --log_path=/var/log/$app/$app-streaming.log --line_match="Stopped"
|
||||
|
||||
# Rename the database to match packaging v2 defaults db_name (`$app_production` to `$app`)
|
||||
if [[ $db_name = *'_production' ]]; then
|
||||
ynh_psql_execute_as_root --sql="ALTER DATABASE $db_name RENAME TO $app;"
|
||||
db_name=$app
|
||||
ynh_app_setting_set --app=$app --key=db_name --value=$db_name
|
||||
fi
|
||||
|
||||
#=================================================
|
||||
# ADD SWAP IF NEEDED
|
||||
#=================================================
|
||||
|
@ -210,6 +206,8 @@ ynh_script_progression --message="Upgrading system configurations related to $ap
|
|||
|
||||
ynh_add_nginx_config
|
||||
|
||||
ynh_use_ruby
|
||||
|
||||
# Create a dedicated systemd config
|
||||
ynh_add_systemd_config --service="$app-web" --template="glitchsoc-web.service"
|
||||
yunohost service add "$app-web" --description="$app web service"
|
||||
|
|
Loading…
Reference in a new issue