-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support enabling / disabling services #3
Comments
Oof: coreos/go-systemd#289 (comment)
So maybe there isn't a good way to show disabled services... |
|
Seems like there is a dbus function I can call: https://www.freedesktop.org/software/systemd/man/latest/systemd.directives.html#ListUnitFiles() Will look into that. |
OK, one problem with that function is that it's pretty slow. Takes about 100ms (user) + 300ms (global) on my 13th gen i7 (Ubuntu 24), I imagine it would be several seconds on slow machines. I don't want that to block startup with that and I'm not sure I should run it too often. My current idea is to track this enabled/disabled/static/masked state as an Option, and occasionally update that state from a background thread that runs infrequently. Semi-related, I think I like this way of thinking about systemd unit state as having 3 components:
From a brainstorming session with 3.5 Sonnet, so take it with a grain of salt:
|
Made some progress on this. Think I'm only going to show disabled and enabled services to start. Showing masked/static/generated services is super noisy and I don't think there's any benefit to it. |
This is stalled for now. Current progress is on the show-disabled-units branch. I got to a point where I could load disabled units reasonably well but refreshing status after enabling/disabling a unit is a bit tricky. I also tried listening for property changes instead of polling for changes but I ran into some weird permissions issues with that. The systemd APIs are really annoying. I will probably come back to this eventually but if anyone else wants to pick up the work (or start fresh) that would be great. |
Right now we only show enabled services. Fix that, then add enable/disable actions.
The text was updated successfully, but these errors were encountered: