diff --git a/check_process b/check_process index d0be191..12788aa 100644 --- a/check_process +++ b/check_process @@ -24,8 +24,6 @@ multi_instance=1 port_already_use=0 change_url=1 -;;; Levels - Level 5=auto ;;; Options Email= Notification=none diff --git a/manifest.json b/manifest.json index 9aa487d..85a3abf 100644 --- a/manifest.json +++ b/manifest.json @@ -10,10 +10,10 @@ "url": "https://etherpad.org/", "license": "Apache-2.0", "maintainer": { - "name": "" + "name": "eric_G" }, "requirements": { - "yunohost": ">= 4.0.7" + "yunohost": ">= 4.0.8" }, "multi_instance": true, "services": [ diff --git a/scripts/backup b/scripts/backup index 7b33d39..f3d4699 100644 --- a/scripts/backup +++ b/scripts/backup @@ -13,10 +13,6 @@ source /usr/share/yunohost/helpers # MANAGE SCRIPT FAILURE #================================================= -ynh_clean_setup () { - ynh_clean_check_starting -} -# Exit if an error occurs during the execution of the script ynh_abort_if_errors #================================================= diff --git a/scripts/change_url b/scripts/change_url index 860179c..8fed290 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -101,15 +101,6 @@ then ynh_store_file_checksum --file="/etc/nginx/conf.d/$new_domain.d/$app.conf" fi -#================================================= -# GENERIC FINALISATION -#================================================= -# START SYSTEMD SERVICE -#================================================= -ynh_script_progression --message="Starting a systemd service..." --weight=6 - -ynh_systemd_action --service_name=$app --action=restart --log_path="systemd" --line_match="Your Etherpad version is" - #================================================= # RELOAD NGINX #================================================= @@ -117,6 +108,14 @@ ynh_script_progression --message="Reloading NGINX web server..." --weight=2 ynh_systemd_action --service_name=nginx --action=reload +#================================================= +# START SYSTEMD SERVICE +#================================================= +ynh_script_progression --message="Starting a systemd service..." --weight=6 + +# Start a systemd service +ynh_systemd_action --action=restart --log_path="systemd" --line_match="Your Etherpad version is" --timeout="120" #--service_name=$app + #================================================= # END OF SCRIPT #================================================= diff --git a/scripts/install b/scripts/install index ee10f7e..453ec4a 100644 --- a/scripts/install +++ b/scripts/install @@ -175,7 +175,7 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 -yunohost service add $app --description "Collaborative editor." --log "/var/log/$app/$app.log" +yunohost service add $app --description="Collaborative editor." --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE @@ -183,7 +183,7 @@ yunohost service add $app --description "Collaborative editor." --log "/var/log/ ynh_script_progression --message="Starting a systemd service..." --weight=6 # Start a systemd service -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is" --timeout="60" #================================================= # SETUP SSOWAT diff --git a/scripts/restore b/scripts/restore index 621fda3..dba8fb7 100644 --- a/scripts/restore +++ b/scripts/restore @@ -58,22 +58,6 @@ ynh_script_progression --message="Restoring the app main directory..." --weight= ynh_restore_file --origin_path="$final_path" -#================================================= -# RECREATE THE DEDICATED USER -#================================================= -ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 - -# Create the dedicated user (if not existing) -ynh_system_user_create --username=$app - -#================================================= -# RESTORE USER RIGHTS -#================================================= - -# Restore permissions on app files -chown -R $app: $final_path -chmod 600 $final_path/credentials.json - #================================================= # REINSTALL DEPENDENCIES #================================================= @@ -95,27 +79,42 @@ ynh_psql_setup_db --db_user=$db_user --db_name=$db_name --db_pwd=$db_pwd ynh_psql_execute_file_as_root --file="./db.sql" --database=$db_name #================================================= -# RESTORE SYSTEMD +# RECREATE THE DEDICATED USER #================================================= -ynh_script_progression --message="Restoring the systemd configuration..." --weight=8 +ynh_script_progression --message="Recreating the dedicated system user..." --weight=1 -#ynh_restore_file --origin_path="/etc -ynh_restore_file --origin_path="/etc/systemd/system/$app.service" -systemctl enable $app.service +# Create the dedicated user (if not existing) +ynh_system_user_create --username=$app --home_dir=$final_path + +#================================================= +# RESTORE USER RIGHTS +#================================================= + +# Restore permissions on app files +chown -R $app: $final_path +chmod 600 $final_path/credentials.json #================================================= # INTEGRATE SERVICE IN YUNOHOST #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=3 -yunohost service add $app --description "Collaborative editor." --log "/var/log/$app/$app.log" +yunohost service add $app --description="Collaborative editor." --log="/var/log/$app/$app.log" + +#================================================= +# RESTORE SYSTEMD +#================================================= +ynh_script_progression --message="Restoring the systemd configuration..." --weight=8 + +ynh_restore_file --origin_path="/etc/systemd/system/$app.service" +systemctl enable $app.service --quiet #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=8 -ynh_systemd_action --service_name=$app --action=restart --log_path="systemd" --line_match="Your Etherpad version is" +ynh_systemd_action --service_name=$app --action=restart --log_path="systemd" --line_match="Your Etherpad version is" --timeout="120" #================================================= # GENERIC FINALIZATION diff --git a/scripts/upgrade b/scripts/upgrade index 483d986..d5d1cc3 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -171,14 +171,14 @@ ynh_add_systemd_config --others_var="ynh_node_load_PATH" #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=2 -yunohost service add $app --description "Collaborative editor." --log "/var/log/$app/$app.log" +yunohost service add $app --description="Collaborative editor." --log="/var/log/$app/$app.log" #================================================= # START SYSTEMD SERVICE #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=6 -ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is" +ynh_systemd_action --service_name=$app --action="start" --log_path="systemd" --line_match="Your Etherpad version is" --timeout="60" #================================================= # RELOAD NGINX