Make systemd not kill child processes of a cron job when it finishes

Signed-off-by: Bowen Ding <dbw9580@live.com>
This commit is contained in:
Bowen Ding 2020-11-16 19:39:22 +08:00 committed by Arthur Schiwon
parent 437be31879
commit 02a7338401
No known key found for this signature in database
GPG Key ID: 7424F1874854DF23

View File

@ -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::