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
Type=oneshot is for services that you want to be considered "up" after they finish running, in conjunction with RemainAfterExit. But we don't do that, so as the doc explains, "the service will never enter "active" unit state, but will directly transition from "activating" to "deactivating" or "dead", since no process is configured that shall run continuously".
I think we want Type=exec, which triggers the command, moves to "running" as it runs, and then once it stops, moves to "dead".
We also have a number of services that don't specify any Type, and are defaulting to Type=simple. I don't think this is wrong, but exec seems like it has slightly better semantics.
Since I introduced all the oneshot ones, I'm going to fix those and leave the simple ones alone.
The text was updated successfully, but these errors were encountered:
`oneshot` is designed to be used with RemainAfterExit, but we don't need
that nor use it. After reviewing
<https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html>,
`exec` appears to be the correct type since we want the service to be
running once the binary has started, not once it's finished.
Practically this shouldn't make a big difference except that `systemctl
start <name>` won't wait for the entire command to complete.
Fixes#7349.
Based on reading https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html,
Type=oneshot
is for services that you want to be considered "up" after they finish running, in conjunction withRemainAfterExit
. But we don't do that, so as the doc explains, "the service will never enter "active" unit state, but will directly transition from "activating" to "deactivating" or "dead", since no process is configured that shall run continuously".I think we want
Type=exec
, which triggers the command, moves to "running" as it runs, and then once it stops, moves to "dead".We also have a number of services that don't specify any Type, and are defaulting to
Type=simple
. I don't think this is wrong, but exec seems like it has slightly better semantics.Since I introduced all the oneshot ones, I'm going to fix those and leave the simple ones alone.
The text was updated successfully, but these errors were encountered: