-
Notifications
You must be signed in to change notification settings - Fork 67
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
Special treatment for dbus daemon #44
Comments
There is already some logic to handle some process special (i.e. Sys-V init). It should be possible to add something to needrestart to handle dbus special, too. |
I've added a restart.d directory allowing to use scripts for restarting selected services. I've adopted your sequence which is shipped as |
I've tested it, it works. Two caveats though: |
Vladimir, this makes a lot of sense, restarts ought to be in the order of dependencies and not in the order shown in the blue text box ... |
Is there a possibility of live-patching daemons now when Ubuntu is offering canonical-livepatch for the kernel? |
I've created a more automated script that handles dbus dependencies without any hardcoding: https://github.com/Vladimir-csp/bashlifehacks/blob/master/restart-dbus
|
I've updated the script, it should work when directly executed now. Will test it with needrestart when appropriate upgrades come by. |
I hope it works for Ubuntu 18.04.1 LTS which I have at home. It is Debian based, right? |
Hi Vladimir, my colleague pointed it out how system logins slow down (on Debian "jessie") if dbus service is restarted. Does your script alleviate this problem? Is it just the problem with the order of the dependencies? Thanks. |
As far as I remember, login slowdown is due to some logind-related components or logind itself loosing dbus connection and acting weird. In general, this is the point of the script: to restart everything that depends on dbus. |
I hope it works for Ubuntu 18.04.1 LTS which I have at home. It is Debian based, right?
Thus far, Ubuntu 18.04.1 LTS requires a restart almost every week. Your script could help to a great deal if tested properly! :-) |
I use Debian testing, it has dbus-affecting upgrades regularly. But not in recent couple of days, so I could only test it standalone and it worked fine that way. Have you tried it on Ubuntu 18.04.1? |
No, not yet I haven't. I have to analyse it first to see what you do with the scripting. I am new to systemd, I am not a systemd expert. I don't even know how to write a systemd script. I had written some init scripts though. Systemd seems fairly too complex. Systemd should be small in footprint and stable regarding features and bugs. We don't need a Swiss knife init, but a stable, reliable init process to start daemons. IMNSHO. |
There is no such thing as "systemd script", it has mostly declarative units. My script just queries information about units and restarts them in needed order. I've added more comments in the code.
Agreed. |
Correct, |
I beg you pardon, shouldn't this IMHO be included in the needrestart when restarting dbus if it is that simple? I don't think people would profit from it anyway until upgrading to Debian stretch at least in backports. Needrestart doesn't select dbus restart by default, restart dbus causes problems, but IMHO doing it right would decrease the need for reboots in the long run and increase availability. |
Hi, just wanted to ask in which version of needrestart this will be included in the main needrestrart tree in the dpkg package and shipped with the distributions? As far as I can see, v2.6 in Ubuntu 16.04.6 LTS doesn't have it, v2.11 in Debian stretch and its jessie backport are first to have it and v3.1 in Ubuntu 18.04.2 LTS has a /etc/needrestart/restart.d/dbus.service ... In a manner of speaking, I have answered my own question, so I only need authoritative information that this is it and that dbus restart had been solved? Or does it still require system reboot on each library change? Many thanks in forward. |
Needrestart currently has an older iteration of dbus restart.d hook with static restart sequence and no protection against destruction of sessions. My new script can serve as a drop-in replacement (plus |
Hi, Vladimir, Thanks, |
systemctl lists dependencies alphabetically, so it does not matter. |
OK then. I still don't know how to put your script into a needrestart restart.d hook. Thus far I have avoided mixing original OS configurations with customizations and modifications. I would probably have to build a replacement dpkg needrestart package, right? How to install your modification in a seamless way. But I have a bite on it. I will have to see whether needrestart uses C lines and libraries ... Perhaps if Ubuntu people do not provide a backport I might have to produce one of my own? |
Just replace restart.d/dbus.service with it. |
I've tested the script with needrestart in actual dbus restart situation. For some reason it took a minute to bring lightdm back, but otherwise no ill effects were observed. I've added a coupe of sleep commands in the sequence just in case. PR is in. |
D-Bus just refused to be restarted:
|
That is something new to me. Could you provide |
It is on a Ubuntu Bionic 18.04.02 LTS host. Needrestart is v3.1 .
|
Wow, they sure do not want it to be restarted. You can try to override this by placing a drop-in into
and hoping that resetting This seems to be an Ubuntu patch from several years ago, dbus 1.10.6-1ubuntu2, 2016-04-01 |
What would be the final conclusion for ubuntu then? To blacklist it? |
Are there any news about this ? Behavior still exists under Ubuntu. Is a blacklisting of dbus the right solution ? |
Also encountered this issue on a machine where I work. |
AFAIR, unit drop-in works, only |
Needrestart offers the possibility to restart dbus daemon among other services, but choosing to do so results in long hang, because systemd is left paralyzed when dbus exits.
While it is stated by dbus developers that dbus should not be restarted, but rather system reboot is required, it is possible to restard dbus with no ill effects. It is just a matter of correct ordering and systemd reexec. I personally use this sequence on my machine:
This way nothing seems to hang or break, the process is almost instant.
The text was updated successfully, but these errors were encountered: