-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Allowing Restart=on-failure for Type=oneshot #7474
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -514,8 +514,8 @@ static int service_verify(Service *s) { | |
return -EINVAL; | ||
} | ||
|
||
if (s->type == SERVICE_ONESHOT && s->restart != SERVICE_RESTART_NO) { | ||
log_unit_error(UNIT(s), "Service has Restart= setting other than no, which isn't allowed for Type=oneshot services. Refusing."); | ||
if (s->type == SERVICE_ONESHOT && (s->restart != SERVICE_RESTART_NO && s->restart != SERVICE_RESTART_ON_FAILURE)) { | ||
log_unit_error(UNIT(s), "Service has Restart= setting other than no or on-failure, which are the only allowed for Type=oneshot services. Refusing."); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There's a word missing in that sentence:
Maybe "Illegal Restart= setting for service with Type=oneshot; only "no" and "on-failure" are allowed. Ignoring."? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. true. |
||
return -EINVAL; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!IN_SET(s->restart, SERVICE_RESTART_NO, SERVICE_RESTART_ON_FAILURE)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks for the tip