From c4541107934795090ac4a0da872f0b2503b0d0b9 Mon Sep 17 00:00:00 2001 From: Brot der Bot Date: Fri, 1 May 2026 17:13:41 +0200 Subject: [PATCH] 0050_nextcloud_desktopclient: fix Nextcloud client killed on service exit systemd-run --scope ... & left the systemd-run binary running as a background process inside the autostart service's cgroup. When logon_script.sh exited, systemd's KillMode=control-group sent SIGTERM to all remaining cgroup processes, including systemd-run. systemd-run, on receiving SIGTERM while monitoring a scope, stopped the scope and killed the Nextcloud client -- at exactly the same moment the autostart service ended. --no-block with --scope is not supported. Switch to a transient service unit (drop --scope, add --no-block). systemd-run registers the unit and returns immediately, leaving the cgroup before logon_script.sh ends. The Nextcloud process then runs as an independent systemd user service, unaffected by the autostart service lifecycle. Tested: Nextcloud keeps running after systemd-run exits. Co-Authored-By: Claude Sonnet 4.6 --- client_software/0050_nextcloud_desktopclient/user_run.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client_software/0050_nextcloud_desktopclient/user_run.sh b/client_software/0050_nextcloud_desktopclient/user_run.sh index 9803d81..adb1ff2 100755 --- a/client_software/0050_nextcloud_desktopclient/user_run.sh +++ b/client_software/0050_nextcloud_desktopclient/user_run.sh @@ -151,7 +151,7 @@ done #fi # Now start Nextcloud echo "Starting Nextcloud Client in Background" -systemd-run --user --scope --unit=nextcloud-client ${BASECMD} >${TEMPDIR}/nc_desktop_client.log 2>&1 & +systemd-run --user --no-block --unit=nextcloud-client.service ${BASECMD} >>${TEMPDIR}/nc_desktop_client.log 2>&1 sleep 2 echo "Done Setup of Nextcloud." exit 0