Describe the bug
dinitctl --force untrigger has been broken for a while and I can't soft disable all my graphical.target dependent services easily.
Expected behaviour I would like to be able to forcefully untrigger the target service to stop all the services that depend on it.
Additional context The last time it worked was around v0.17.0.
Activity
8dinitctl untrigger simply removes the trigger condition, it doesn't cause a service or its dependents to stop. --force has never had any effect with this command.
If you want to stop the service and all services that depend on it, use dinitctl stop --force graphical.target.
dinitctl untrigger simply removes the trigger condition, it doesn't cause a service or its dependents to stop. --force has never had any effect with this command.
If you want to stop the service and all services that depend on it, use dinitctl stop --force graphical.target.
@Elvyria can I close this?
@Elvyria can I close this?
Please don't, because it's a problem and now I'll need to revert to like 5 versions back reverting half of the service files or what not to proof that I'm not crazy and it was working before.
Turnstile on a log-in puts graphical.target to a starting state when it waits for me to trigger it by initializing DISPLAY or WAYLAND_DISPLAY env variables for graphical.monitor, which I do in my WM's config. But sometimes I find myself in a situation when I need to restart my graphical environment without restarting everything else. So in the past it was just a matter of calling untrigger with the --force flag, or maybe I didn't even need a flag, and all the services that had depends-on = graphical.target would be stopped automatically and graphical.target would be put back in a starting state.
At the present time I cannot call untrigger on a graphical.target anymore, because running services are depending on it and dinit is sad about this. If i just stop the service i won't be able to trigger it again because it won't be in a starting state.
Ideally it would be amazing to be able to just dinitctl unsetenv DISPLAY which would cause the graphical.monitor aka /usr/bin/dinit-monitor -E -c "/usr/lib/turnstile/dinit graphical-notify" WAYLAND_DISPLAY DISPLAY to untrigger the graphical.target automatically.
I don't know what to do to make it work as it was before, so here we are.
I've taken a quick look at the code at 0.17.0 and I can say with confidence that both:
--forcedid not have an effect (in fact it's not accepted) for theuntriggercommanduntriggernever causes a service to stop by itself, it just removes the trigger condition
At the present time I cannot call
untriggeron agraphical.targetanymore, because running services are depending on it and dinit is sad about this.
I'm not sure what you mean here - there shouldn't be any problem using untrigger on a started service regardless of whether services are depending on it. I just verified with a quick test that this works as it should at least in a simple case.
If i just stop the service i won't be able to trigger it again because it won't be in a starting state.
You should be able to use dinitctl untrigger graphical.target followed by dinitctl restart --force graphical.target to get the behaviour that you described (i.e. stop all dependents and put graphical.target back in starting state).
I'm happy to leave the issue open a while longer while you verify this.
So, tried the solution that you provided and it worked when I was calling it manually from the TTY, but not when invoking from the WM's config which was really confusing, but I found the problem. Calling :
dinitctl unsetenv DISPLAY
dinitctl untrigger graphical.target
dinitctl restart --force graphical.targetin this order has a race condition, where dinitctl unsetenv DISPLAY triggers not before, but after the fact that the service was untriggered and just triggers it again, since dinit-monitor reacts to all env changes as I know now from the man page.
The solution (or a workaround) for now is to not call dinitctl unsetenv at all. Then I can call untrigger + restart combo to make all dependent services happily shutdown and not crash into oblivion without a way to properly restart them all.
Not perfect, but I guess we can close this, since this is good enough for me.
dinitctl untriggersimply removes the trigger condition, it doesn't cause a service or its dependents to stop.--forcehas never had any effect with this command.If you want to stop the service and all services that depend on it, use
dinitctl stop --force graphical.target.