FS#75846 - [nextcloud] nextcloud-cron.service is missing KillMode= directive

Attached to Project: Community Packages
Opened by Andreas Radke (AndyRTR) - Thursday, 08 September 2022, 05:22 GMT
Last edited by David Runge (dvzrv) - Friday, 09 September 2022, 09:44 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
David Runge (dvzrv)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Our current nextcloud-cron.service misses the KillMode directive
https://github.com/archlinux/svntogit-community/blob/packages/nextcloud/trunk/nextcloud-cron.service

Check Nexcloud documentation: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#systemd
"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."

This should prevent unwanted data loss or memory corruption or even memory leaks.

But I suggest to follow https://www.freedesktop.org/software/systemd/man/systemd.kill.html upstream recommendation and prefer
"KillMode=mixed"
"If set to mixed, the SIGTERM signal (see below) is sent to the main process while the subsequent SIGKILL signal (see below) is sent to all remaining processes of the unit's control group. If set to process, only the main process itself is killed (not recommended!). If set to none, no process is killed (strongly recommended against!). In this case, only the stop command will be executed on unit stop, but no process will be killed otherwise. Processes remaining alive after stop are left in their control group and the control group continues to exist after stop unless empty."

I'm not sure if using "control-group" mode could even be better. But this would probably need some additional ExecStop= command.
This task depends upon

Closed by  David Runge (dvzrv)
Friday, 09 September 2022, 09:44 GMT
Reason for closing:  Fixed
Additional comments about closing:  Fixed with nextcloud 24.0.5-1
Comment by David Runge (dvzrv) - Friday, 09 September 2022, 09:31 GMT
@AndyRTR: Thanks for the ticket!

I will add this for 24.0.5!

Loading...