You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Script execution terminated when using systemd timer as cron job scheduler #67
Set up a workflow script that requires quite some time to run, e.g. sleep 10; echo "finished" > /tmp/flow_output
Trigger the cron job, e.g. from command line systemctl start nextcloudcron.service
Expected behaviour
The workflow script finishes successfully.
Actual behaviour
Nothing happens. No output in /tmp/flow_output.
Workflow Script app
1.4.0
Workaround
Because systemd defaults to kill all the processes of a service unit as soon as the main process has exited, once the php process exits, the child process where the flow script is running will be killed, too. Making systemd only kill the main process but leaving all child processes intact works around this problem (ref: systemd.kill).
Append KillMode=process to the nextcloudcron.service file:
I'm not sure if this issue should be filed here, or under the server repo, or the documentation repo. I feel that posting it here may save someone who runs into the same problem hours of researching.
Activity
MorrisJobke commentedon Nov 19, 2020
cc @blizzz
kesselb commentedon Nov 20, 2020
workflow_script/lib/BackgroundJobs/Launcher.php
Lines 69 to 76 in 145ae8f
The command is executed as subshell on purpose. So the suggest change to the documentation makes sense to me.
blizzz commentedon Jan 14, 2021
@dbw9580 thanks for the report, analysis and the documentation PR. Closing hence it is merged.