-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
[BUG] 3004rc1: Service states incorrectly report they will restart in test mode #60995
Comments
@OrangeDog Taking a quick look at this and it doesn't appear that it's related to having the watch requisite. The message is still displayed when it's not included. |
#60150 looks like a likely candidate @dmurphy18 |
I'm seeing the same thing with all services on Alma Linux 8 (didn't check with others yet). I have this, for example:
The prerequisite didn't have changes. |
This problem was reported previously: #60284 (comment) IMO it's a more wrong now than it was before. |
So this problem is being reported in multiple issues but at the time the fix for issue #60120 and PR #60150 were correct for that particular issue. To correctly address some of these situations, really need a method to query systemd for if some specific service B will restart if I restart this service A. As far as I know, there is nothing that lets you quickly walk down dependency chains in systemd, but I am all ears to be corrected. Goggled away and didn't find anything, perhaps someone on this issue might know of a way. Given this is a test operation, it is lower down the pecking order and operational bugs take precedence. Hence, looking for any ideas from the community as to a best way to address this issue, since blindly assuming dependencies will be restarted too is not appropriate, and I would prefer not to add weasel words to messages. |
To add some additional color to this issue, |
I'm not 100% sure about what you want to achieve with "need a method to query systemd for if some specific service B will restart if I restart this service A". I assume you want to print all services that would be restarted, but I'm not sure. For reload the situation is simpler.
This is from a real example where I also have:
The above means that starts, stops and restarts would also be propagated (Except for bugs. For example, For a simplistic approach I'd implement the proper handling (writing out what would happen) for the named service only plus the things listed above because that's fairly easy. I suppose you'd have to use DBus interface instead of I don't know of a simple way to handle dependencies introduced by |
I don't see why any of this is necessary. Salt shouldn't be reporting what systemd is going to to, it should just report what Salt is going to do. The logic is completely contained within the state: whether it's going to do nothing, start a not-running service, or restart a running service. To correctly address the situation, all you have to do is have the state code, but don't actually do the final action if The initial bug was due to other states not returning changes correctly. It has nothing to do with dependencies inside systemd. Salt shouldn't care about that. The change should probably just be reverted. |
One other thing. You might be tempted to add a warning about a possibility that other services might be restarted to the return dict from So if you introduce a warning text that becomes a sort of an API because there's nothing else to differentiate warnings which should be ignored. The test program is using It would be better if warning was a dict with some code string that would never change and a message text that could change. This is not a feature request, I'm just letting you know about the existing usage. |
I don't either, but if somebody wants to deliver more features than strictly necessary I won't object. |
It's not a feature, it's just wrong. Test mode should only report what the state is going to do, not what some side-effects of some other command might be. |
You have a point there. |
👍 |
Can be closed by #61019 |
Description
Every
service.running
state, all of which have some sort of watch requisite, reports that it will restart when running in test mode. During an actual apply they correctly do not.Setup
Both minions have the same highstate (except for hostname/network/etc. parameters).
A selection of the states involved:
Steps to Reproduce the behavior
Expected behavior
Both minions should report no changes.
Versions Report
minion1 (3004rc1)
minion2 (3003.3)
The text was updated successfully, but these errors were encountered: