diff --git a/conf/funkwhale-beat.service b/conf/funkwhale-beat.service index 5913bbc..bafe99a 100644 --- a/conf/funkwhale-beat.service +++ b/conf/funkwhale-beat.service @@ -13,6 +13,7 @@ ExecStart=__INSTALL_DIR__/venv/bin/celery \ --app funkwhale_api.taskapp \ beat \ --loglevel INFO + --error-logfile /var/log/__APP__/__APP__-beat.log # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/conf/funkwhale-worker.service b/conf/funkwhale-worker.service index 4cf8fde..2b1012e 100644 --- a/conf/funkwhale-worker.service +++ b/conf/funkwhale-worker.service @@ -15,6 +15,7 @@ ExecStart=__INSTALL_DIR__/venv/bin/celery \ worker \ --loglevel INFO \ --concurrency=${CELERYD_CONCURRENCY} + --error-logfile /var/log/__APP__/__APP__-worker.log # Sandboxing options to harden security # Depending on specificities of your service/app, you may need to tweak these diff --git a/scripts/change_url b/scripts/change_url index 8863bd4..aa87db4 100644 --- a/scripts/change_url +++ b/scripts/change_url @@ -47,9 +47,9 @@ ynh_exec_warn_less ynh_exec_as $app $install_dir/venv/bin/funkwhale-manage fix_f #================================================= ynh_script_progression --message="Starting a systemd service..." --weight=1 -ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="/var/log/$app/$app.log" -ynh_systemd_action --service_name="$app-server" --action="start" --log_path="/var/log/$app/$app.log" -ynh_systemd_action --service_name="$app-worker" --action="start" --log_path="/var/log/$app/$app.log" +ynh_systemd_action --service_name="$app-beat" --action="start" --log_path="/var/log/$app/${app}-beat.log" +ynh_systemd_action --service_name="$app-server" --action="start" --log_path="/var/log/$app/${app}-server.log" +ynh_systemd_action --service_name="$app-worker" --action="start" --log_path="/var/log/$app/${app}-worker.log" #================================================= # END OF SCRIPT diff --git a/scripts/install b/scripts/install index 73a900d..4802c01 100644 --- a/scripts/install +++ b/scripts/install @@ -76,9 +76,9 @@ ynh_script_progression --message="Configuring a systemd service..." --weight=1 ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" -ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" -ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --log="/var/log/__APP__/__APP__-server.log" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --log="/var/log/__APP__/__APP__-worker.log" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --log="/var/log/__APP__/__APP__-beat.log" #================================================= # INSTALL PYTHON DEPENDENCIES diff --git a/scripts/restore b/scripts/restore index ac8b07e..cfc6867 100644 --- a/scripts/restore +++ b/scripts/restore @@ -79,9 +79,9 @@ systemctl enable "${app}-worker.service" --quiet #================================================= ynh_script_progression --message="Integrating service in YunoHost..." --weight=1 -yunohost service add "${app}-beat" -yunohost service add "${app}-server" -yunohost service add "${app}-worker" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --log="/var/log/__APP__/__APP__-server.log" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --log="/var/log/__APP__/__APP__-worker.log" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --log="/var/log/__APP__/__APP__-beat.log" #================================================= # START SYSTEMD SERVICE diff --git a/scripts/upgrade b/scripts/upgrade index eac6459..3be11f5 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -132,9 +132,9 @@ ynh_script_progression --message="Upgrading systemd configuration..." --weight=1 ynh_add_config --template="../conf/funkwhale.target" --destination="/etc/systemd/system/$app.target" # Create a dedicated systemd config -ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" -ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" -ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" +ynh_add_systemd_config --service="${app}-server" --template="funkwhale-server.service" --log="/var/log/__APP__/__APP__-server.log" +ynh_add_systemd_config --service="${app}-worker" --template="funkwhale-worker.service" --log="/var/log/__APP__/__APP__-worker.log" +ynh_add_systemd_config --service="${app}-beat" --template="funkwhale-beat.service" --log="/var/log/__APP__/__APP__-beat.log" #================================================= # GENERIC FINALIZATION