feat: implement X-RestartIfChanged=false in service activation#438
Open
feat: implement X-RestartIfChanged=false in service activation#438
Conversation
00a7211 to
29c2665
Compare
29c2665 to
3b57c94
Compare
We parse the directive from the unit file text and skip restarting the service if X-RestartIfChanged=false is set required for #436
3b57c94 to
b202740
Compare
picnoir
reviewed
Apr 9, 2026
Member
picnoir
left a comment
There was a problem hiding this comment.
Overall 👍
But I feel like the parser needs to do a little bit more than string matching.
| return false; | ||
| } | ||
| if let Some(ref path) = service.store_path { | ||
| if unit_has_directive(path, "X-RestartIfChanged=false") { |
Member
There was a problem hiding this comment.
[Service]
#X-RestartIfChanged=false😛
Looking at man systemd.syntax, we can also have whitespaces around the equal sign:
Each file is a plain text file divided into sections, with configuration entries in the style key=value. Whitespace immediately before or after the "=" is ignored. Empty lines and lines starting with "#" or ";" are ignored, which may be used commenting.
Maybe check if there's a parser for that.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Prevents the engine from restarting services like the auto-upgrade service mid-execution when their unit files change.
required for #436