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
switch-to-configuration.pl: Interact via DBus #1665
Conversation
Currently switch-to-configuration.pl uses system() calls to interact with DBus. This can be error prone, especially when we are parsing output that could change. In this commit, almost all calls to the systemctl binary have been replaced with equivalent operations via DBus.
This obviously needs people to help test. So far I've tried enabling and disabling services, and it has behaved as expected. |
+1. @edolstra are you willing to take a look at this? Otherwise I will but it may be some time before I can do it properly. |
Seems like a good idea to me (but haven't tested yet). The only downside would be that switch-to-configuration will fail if dbus is down. But I guess that won't be a problem anymore in the glorious kdbus future. |
@edolstra do you have any thoughts on what should be tested for this? It seems like something we should have. |
I don't have time to test this right now, but I've added the |
Will test and try to get this in before |
@ocharles This looks good to me, can you bring it up to date and we can merge? |
Sure thing, will try and get that done tonight or tomorrow.
|
Just updated systemd to 212, but I don't think it changes the d-bus API. (It did change the "systemctl" output...) |
Conflicts: nixos/modules/system/activation/switch-to-configuration.pl
I've merged master in - do we want to get this in for the next release, or give it time to have more testing? I think for something so essential, we may be better waiting. |
We'll have a week+ for testing after this is in, I'd like to get this in if you're up for it. I tested the current state already against nixpkgs of a few weeks ago |
Sure, I'm fine with that - just wanted to make sure others were :) On Sun, Apr 20, 2014 at 7:39 PM, Shea Levy notifications@github.com wrote:
|
@ocharles Is this ready to merge? |
I'm just testing it now, will merge if everything checks out OK. |
So has anybody tested what happens if dbus is restarted by switch-to-configuration? |
I've
Then dbus was dead. I could
|
Reverted for now, as @ocharles may not have time to look at the problems caused by the new systemd in conjunction with this. We will revisit after 14.04. |
Hmm, it seems impossible to reopen a merged PR. |
Don't worry, I'll open a new one shortly
|
Another that occured to me is that starting units via d-bus breaks password prompts. (Systemctl spawns |
How does |
Systemctl doesn't use dbus at all if you're running as root. Also, it does more than talk to systemd - it also starts systemd-tty-ask-password-agent. |
Right, but what interface does it use? |
The |
Currently switch-to-configuration.pl uses system() calls to interact
with DBus. This can be error prone, especially when we are parsing
output that could change. In this commit, almost all calls to the
systemctl binary have been replaced with equivalent operations via DBus.