mirror of
https://github.com/YunoHost-Apps/fittrackee_ynh.git
synced 2024-09-03 18:36:16 +02:00
upgrade/restore
This commit is contained in:
parent
9f14e2ac5f
commit
ebfb32aebd
2 changed files with 13 additions and 18 deletions
|
@ -31,10 +31,10 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
||||||
# BACKUP SYSTEMD
|
# BACKUP SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/${app}-beat.service"
|
|
||||||
ynh_backup --src_path="/etc/systemd/system/${app}-server.service"
|
ynh_backup --src_path="/etc/systemd/system/${app}.service"
|
||||||
ynh_backup --src_path="/etc/systemd/system/${app}-worker.service"
|
ynh_backup --src_path="/etc/systemd/system/${app}_workers.service"
|
||||||
ynh_backup --src_path="/etc/systemd/system/$app.target"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# BACKUP THE POSTGRESQL DATABASE
|
# BACKUP THE POSTGRESQL DATABASE
|
||||||
|
|
|
@ -37,39 +37,34 @@ ynh_restore_file --origin_path="$install_dir"
|
||||||
|
|
||||||
chmod 750 "$install_dir"
|
chmod 750 "$install_dir"
|
||||||
chmod -R o-rwx "$install_dir"
|
chmod -R o-rwx "$install_dir"
|
||||||
chown -R $app:www-data "$install_dir"
|
chown -R $app: "$install_dir"
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# RESTORE SYSTEMD
|
# RESTORE SYSTEMD
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
ynh_script_progression --message="Restoring the systemd configuration..." --weight=1
|
||||||
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/${app}-beat.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/${app}.service"
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/${app}-server.service"
|
ynh_restore_file --origin_path="/etc/systemd/system/${app}_workers.service"
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/${app}-worker.service"
|
|
||||||
ynh_restore_file --origin_path="/etc/systemd/system/$app.target"
|
|
||||||
|
|
||||||
systemctl enable "${app}-beat.service" --quiet
|
systemctl enable "${app}.service" --quiet
|
||||||
systemctl enable "${app}-server.service" --quiet
|
systemctl enable "${app}_workers.service" --quiet
|
||||||
systemctl enable "${app}-worker.service" --quiet
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# INTEGRATE SERVICE IN YUNOHOST
|
# INTEGRATE SERVICE IN YUNOHOST
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
ynh_script_progression --message="Integrating service in YunoHost..." --weight=1
|
||||||
|
|
||||||
yunohost service add "${app}-beat"
|
yunohost service add "${app}"
|
||||||
yunohost service add "${app}-server"
|
yunohost service add "${app}_workers"
|
||||||
yunohost service add "${app}-worker"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# START SYSTEMD SERVICE
|
# START SYSTEMD SERVICE
|
||||||
#=================================================
|
#=================================================
|
||||||
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
ynh_script_progression --message="Starting a systemd service..." --weight=1
|
||||||
|
|
||||||
ynh_systemd_action --service_name="${app}-beat" --action="start" --log_path="systemd" --line_match="Started"
|
ynh_systemd_action --service_name="${app}" --action="start" --log_path="/var/log/$app/$app.log" --line_match="Booting worker with pid"
|
||||||
ynh_systemd_action --service_name="${app}-server" --action="start" --log_path="systemd" --line_match="Booting worker with pid"
|
ynh_systemd_action --service_name="${app}_workers" --action="start" --log_path="systemd" --line_match="ready"
|
||||||
ynh_systemd_action --service_name="${app}-worker" --action="start" --log_path="systemd" --line_match="ready"
|
|
||||||
|
|
||||||
#=================================================
|
#=================================================
|
||||||
# GENERIC FINALIZATION
|
# GENERIC FINALIZATION
|
||||||
|
|
Loading…
Reference in a new issue