From 0514de5f4ab8091ffb83be07ca295bca11122209 Mon Sep 17 00:00:00 2001 From: Glenn Date: Fri, 16 May 2025 16:46:39 +0200 Subject: [PATCH] feat: add supervisor program for background worker --- supervisor.conf.d/background-worker.conf | 30 ++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 supervisor.conf.d/background-worker.conf diff --git a/supervisor.conf.d/background-worker.conf b/supervisor.conf.d/background-worker.conf new file mode 100644 index 0000000..396c261 --- /dev/null +++ b/supervisor.conf.d/background-worker.conf @@ -0,0 +1,30 @@ +[program:nextcloud-background-worker] +; Root directory of your Nextcloud instance +directory=/var/www/nextcloud + +; Exact command to run +command=/usr/bin/local/php occ background-job:worker -v -t 60 "OC\\TaskProcessing\\SynchronousBackgroundJob" + +; Run directly as the www-data user +user=www-data + +; Automatic start and restart +autostart=true ; start as soon as supervisord starts +autorestart=true ; always restart +startsecs=10 ; 10 seconds after supervisord starts +startretries=3 ; 3 attempts before considering it “failed” + +; Proper signal handling (useful if the worker spawns children) +stopasgroup=true +killasgroup=true + +; Dedicated logs for easier troubleshooting +; stdout_logfile=/var/log/supervisor/nextcloud-worker.out.log +; stderr_logfile=/var/log/supervisor/nextcloud-worker.err.log +; stdout_logfile_maxbytes=5MB +; stderr_logfile_maxbytes=5MB +; stdout_logfile_backups=3 +; stderr_logfile_backups=3 + +; (optional) Additional environment variables +; environment=PATH="/usr/local/bin:/usr/bin:/bin"