-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
RemainAfterExit should respect return codes and/or Restart= modes #3396
Comments
Well, strictly speaking service had never been started in the first place, so Restart logically does not apply here. This would need new directive with semantic "keep starting this service even if initial attempt fails". Although exact semantic is rather hairy - what to do with all ExecStartPre? Should they be repeated or not? Should any cleanup be attempted (i.e. ExecStop*)? |
Perhaps something like And my votes on the semantics would be: repeat |
Note that another side-effect is that while the exit code of the unit is 1, its state is "active", not "failed" which makes I think that |
@binarybana I apologize, I misunderstood it. In case of simple service it is already started as soon as main process is spawned. So the problem is indeed interaction with @Keruspe Yes, and when service is stopped ( I wonder whether |
1. Instead of using hardcoded timeout (5 secs) before loading wlan we wait when wcnsscore is ready by polling wcnss_is_ready parameter. 2. Add wcnss_wlan.device as dependency, there is no point in trying to start wlan without this device. 3. Switch to Type=forking because it's only type of unit which tries to restart service in case of failed state (see systemd/systemd#3396 and systemd/systemd#2582)
1. Instead of using hardcoded timeout (5 secs) before loading wlan we wait when wcnsscore is ready by polling wcnss_is_ready parameter. 2. Add wcnss_wlan.device as dependency, there is no point in trying to start wlan without this device. 3. Switch to Type=forking because it's only type of unit which tries to restart service in case of failed state (see systemd/systemd#3396 and systemd/systemd#2582)
I stumbled across this when creating a There is currently no way to achieve this, right? edit: Actually, If you tell tmux to |
Submission type
systemd version the issue has been seen with
Used distribution
Using something like
Despite the fact that the service fails, it does not get restarted. Ideally I could specify something like
RemainAfterExit=on-success
to only remain if exiting with a success return code.My primary use case for this is using
Type=simple
jobs for one off scripts at bootup (like formatting drives) where I needRestart=on-failure
but alsoRemainAfterExit
. This relates to (but is distinct from) #2582, because even with that issue fixed, you'd still want to add this behavior.The text was updated successfully, but these errors were encountered: