From 02a73384019a8fbec367b44138c1e44563384e69 Mon Sep 17 00:00:00 2001 From: Bowen Ding Date: Mon, 16 Nov 2020 19:39:22 +0800 Subject: [PATCH] Make systemd not kill child processes of a cron job when it finishes Signed-off-by: Bowen Ding --- .../configuration_server/background_jobs_configuration.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/admin_manual/configuration_server/background_jobs_configuration.rst b/admin_manual/configuration_server/background_jobs_configuration.rst index d4c2a709f..8674eee59 100644 --- a/admin_manual/configuration_server/background_jobs_configuration.rst +++ b/admin_manual/configuration_server/background_jobs_configuration.rst @@ -106,10 +106,13 @@ This approach requires two files: **nextcloudcron.service** and **nextcloudcron. [Service] User=www-data - ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php + ExecStart=/usr/bin/php -f /var/www/nextcloud/cron.php + KillMode=process Replace the user ``www-data`` with the user of your http server and ``/var/www/nextcloud/cron.php`` with the location of **cron.php** in your nextcloud directory. +The ``KillMode=process`` setting is necessary for external programs that are started by the cron job to keep running after the cron job has finished. + Note that the **.service** unit file does not need an ``[Install]`` section. Please check your setup because we recommended it in earlier versions of this admin manual. **nextcloudcron.timer** should look like this::