c454110793
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 <noreply@anthropic.com>