diff --git a/conf/funkwhale-beat.service b/conf/funkwhale-beat.service index 945288b..80a0d33 100644 --- a/conf/funkwhale-beat.service +++ b/conf/funkwhale-beat.service @@ -9,9 +9,6 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/code/api EnvironmentFile=__FINALPATH__/code/config/.env -PermissionsStartOnly=true -ExecStartPre=/bin/mkdir -p /var/log/__APP__ -ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__ ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp beat \ --loglevel INFO --logfile=/var/log/__APP__/beat.log diff --git a/conf/funkwhale-server.service b/conf/funkwhale-server.service index c19144b..9152bc0 100644 --- a/conf/funkwhale-server.service +++ b/conf/funkwhale-server.service @@ -9,9 +9,6 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/code/api EnvironmentFile=__FINALPATH__/code/config/.env -PermissionsStartOnly=true -ExecStartPre=/bin/mkdir -p /var/log/__APP__ -ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__ ExecStart=__FINALPATH__/code/virtualenv/bin/daphne -b ${FUNKWHALE_API_IP} -p ${FUNKWHALE_API_PORT} config.asgi:application --proxy-headers \ --verbosity 1 --access-log=/var/log/__APP__/server.log diff --git a/conf/funkwhale-worker.service b/conf/funkwhale-worker.service index f641ba0..f465cdf 100644 --- a/conf/funkwhale-worker.service +++ b/conf/funkwhale-worker.service @@ -9,9 +9,6 @@ Group=__APP__ WorkingDirectory=__FINALPATH__/code/api EnvironmentFile=__FINALPATH__/code/config/.env -PermissionsStartOnly=true -ExecStartPre=/bin/mkdir -p /var/log/__APP__ -ExecStartPre=/bin/chown __APP__:__APP__ /var/log/__APP__ ExecStart=__FINALPATH__/code/virtualenv/bin/celery -A funkwhale_api.taskapp worker -l INFO \ --loglevel INFO --logfile=/var/log/__APP__/worker.log diff --git a/scripts/install b/scripts/install index 7a0dd70..e998f84 100644 --- a/scripts/install +++ b/scripts/install @@ -226,6 +226,9 @@ systemctl restart "$app".target chown -R "$app": "$final_path" chmod -R 755 "$final_path/code/front/dist/" +mkdir -p "/var/log/$app" +chown -R "$app": "/var/log/$app" + #================================================= # SETUP FAIL2BAN #================================================= diff --git a/scripts/remove b/scripts/remove index afa46f7..188f246 100644 --- a/scripts/remove +++ b/scripts/remove @@ -24,19 +24,6 @@ redis_db=$(ynh_app_setting_get $app redis_db) #================================================= # STANDARD REMOVE -#================================================= -# STOP AND REMOVE SERVICE -#================================================= - -systemctl stop "$app".target - -# Remove the dedicated systemd config -ynh_remove_systemd_config "$app-server" -ynh_remove_systemd_config "$app-worker" -ynh_remove_systemd_config "$app-beat" - -ynh_secure_remove "/etc/systemd/system/$app.target" - #================================================= # REMOVE SERVICE FROM ADMIN PANEL #================================================= @@ -60,6 +47,19 @@ then yunohost service remove "$app-beat" fi +#================================================= +# STOP AND REMOVE SERVICE +#================================================= + +systemctl stop "$app".target + +# Remove the dedicated systemd config +ynh_remove_systemd_config "$app-server" +ynh_remove_systemd_config "$app-worker" +ynh_remove_systemd_config "$app-beat" + +ynh_secure_remove "/etc/systemd/system/$app.target" + #================================================= # REMOVE THE PostgreSQL DATABASE #================================================= @@ -88,6 +88,8 @@ ynh_remove_app_dependencies # Remove the app directory securely ynh_secure_remove "$final_path" +ynh_secure_remove "/var/log/$app" + #================================================= # REMOVE NGINX CONFIGURATION #================================================= diff --git a/scripts/restore b/scripts/restore index c40b1dd..319d9e0 100644 --- a/scripts/restore +++ b/scripts/restore @@ -115,6 +115,9 @@ ynh_psql_execute_file_as_root ./db.sql "$db_name" # Restore permissions on app files chown -R "$app": "$final_path" +mkdir -p "/var/log/$app" +chown -R "$app": "/var/log/$app" + #================================================= # ADVERTISE SERVICE IN ADMIN PANEL #================================================= diff --git a/scripts/upgrade b/scripts/upgrade index 1bd9d5b..1c185ed 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -236,6 +236,9 @@ systemctl restart "$app".target chown -R "$app": "$final_path" chmod -R 755 "$final_path/code/front/dist/" +mkdir -p "/var/log/$app" +chown -R "$app": "/var/log/$app" + #================================================= # SETUP FAIL2BAN #=================================================