Skip to content

change service type to oneshot #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 6, 2025
Merged

change service type to oneshot #5

merged 1 commit into from
Mar 6, 2025

Conversation

mheyen
Copy link
Contributor

@mheyen mheyen commented Mar 6, 2025

This patch prevents the ExecStartPost (cleanup) command to start before the backup is finished.
With the service Type=simple, the cleanup is started right after the backup has been started.
With the service Type=oneshot, the cleanup starts only when the process exited successfully.

see https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#ExecStartPre=

ExecStartPost= commands are only run after the commands specified in ExecStart= have been invoked successfully, as determined by Type= (i.e. the process has been started for Type=simple or Type=idle, the last ExecStart= process exited successfully for Type=oneshot, the initial process exited successfully for Type=forking, "READY=1" is sent for Type=notify/Type=notify-reload, or the BusName= has been taken for Type=dbus).

@mheyen mheyen requested a review from lkiesow March 6, 2025 08:55
@lkiesow lkiesow merged commit 901b683 into main Mar 6, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants