From 96a200c7a6b29fe07e18771e6736b90987f34d6c Mon Sep 17 00:00:00 2001 From: yalh76 Date: Sun, 11 Apr 2021 22:11:16 +0200 Subject: [PATCH] Fix rights --- scripts/install | 18 +++++++++--------- scripts/restore | 2 +- scripts/upgrade | 18 +++++++++--------- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/scripts/install b/scripts/install index b8e13ae..4cb2ff6 100644 --- a/scripts/install +++ b/scripts/install @@ -89,7 +89,7 @@ popd chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -115,14 +115,6 @@ pushd $final_path venv/bin/pip install 'websockets>=6.0,<7.0' popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Configuring a systemd service..." - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # ADD A CONFIGURATION #================================================= @@ -133,6 +125,14 @@ ynh_add_config --template="yunorunner.config.py" --destination="$final_path/conf chmod 400 "$final_path/config.py" chown $app:$app "$final_path/config.py" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Configuring a systemd service..." + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # GENERIC FINALIZATION #================================================= diff --git a/scripts/restore b/scripts/restore index d1ad259..dc2d712 100644 --- a/scripts/restore +++ b/scripts/restore @@ -73,7 +73,7 @@ ynh_restore_file --origin_path="$final_path" chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # SPECIFIC RESTORATION diff --git a/scripts/upgrade b/scripts/upgrade index 3fec468..dde97b1 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -121,7 +121,7 @@ fi chmod 750 "$final_path" chmod -R o-rwx "$final_path" -chown -R root:$app "$final_path" +chown -R $app:$app "$final_path" #================================================= # NGINX CONFIGURATION @@ -154,14 +154,6 @@ pushd $final_path venv/bin/pip install 'websockets>=6.0,<7.0' popd -#================================================= -# SETUP SYSTEMD -#================================================= -ynh_script_progression --message="Upgrading systemd configuration..." - -# Create a dedicated systemd config -ynh_add_systemd_config - #================================================= # UPDATE A CONFIG FILE #================================================= @@ -172,6 +164,14 @@ ynh_add_config --template="yunorunner.config.py" --destination="$final_path/conf chmod 400 "$final_path/config.py" chown $app:$app "$final_path/config.py" +#================================================= +# SETUP SYSTEMD +#================================================= +ynh_script_progression --message="Upgrading systemd configuration..." + +# Create a dedicated systemd config +ynh_add_systemd_config + #================================================= # GENERIC FINALIZATION #=================================================