DevHeads.net

kded: Disable KHostnameD in KDED

Git commit 8d99f863724c6fe76d008da4455fa177af2ee3ee by Àlex Fiestas.
Committed on 15/04/2013 at 12:24.
Pushed by afiestas into branch 'master'.

Disable KHostnameD in KDED

KHostnameD monitors the hostname by polling gethostname every 5 seconds
to adapt some bits of the environment in case the hostname changes. In
systems with only a local X server this does not matter at all. In
systems using remote X you should not change your hostname, period.
In most distributions changing your hostname no longuer breaks X access
for local applications since xhost is configured correctly. In summary
there is NO reason to keep this around.

Besides that, kdontchangethehostname (binay that is called when the
hostname is changed) does not work if your DISPLAY env is like ":0"
which is the format that can be found in all distributions nowdays
(old format was domain/[unix,tcp,...]:0).

Even fixing it, most distributions use a global Xauthority pointed by
the DM or XAUTHORITY env which points to either /run/*dm/... or in
/tmp/user.... Meaning that the most important adaptation to the new
hostname that kdontchangethehostname does won't work either.

If this is ever enabled again the polling should be removed by either
using systemd-hostnamed or inotify+/etc/hostname but polling won't
be accepted.

This commits only disables the code, if nobody complains I will remove
the full code before 4.11 is out.

CCMAIL:kde-core- ... at kde dot org

M +1 -1 kded/kded.cpp

<a href="http://commits.kde.org/kdelibs/8d99f863724c6fe76d008da4455fa177af2ee3ee" title="http://commits.kde.org/kdelibs/8d99f863724c6fe76d008da4455fa177af2ee3ee">http://commits.kde.org/kdelibs/8d99f863724c6fe76d008da4455fa177af2ee3ee</a>

diff --git a/kded/kded.cpp b/kded/kded.cpp
index b594692..b611972 100644
--- a/kded/kded.cpp
+++ b/kded/kded.cpp
@@ -842,7 +842,7 @@ public:
#endif

if (bCheckHostname)
- (void) new KHostnameD(HostnamePollInterval); // Watch for hostname changes
+// (void) new KHostnameD(HostnamePollInterval); // Watch for hostname changes

kded->initModules();
} else

Comments

Re: kded: Disable KHostnameD in KDED

By Martin =?ISO-88... at 04/15/2013 - 07:17

On Monday 15 April 2013 12:43:21 Àlex Fiestas wrote:

Re: kded: Disable KHostnameD in KDED

By Martin Sandsmark at 04/15/2013 - 07:10

On Mon, Apr 15, 2013 at 12:43:21PM +0200, Àlex Fiestas wrote:
I thought kdelibs master was closed for everything except bug fixes?

And why didn't this go through reviewboard?

Re: Re: [kdelibs] kded: Disable KHostnameD in KDED

By Martin =?ISO-88... at 04/15/2013 - 07:17

On Monday 15 April 2013 13:10:09 Martin Sandsmark wrote:

Re: Re: [kdelibs] kded: Disable KHostnameD in KDED

By Martin Sandsmark at 04/15/2013 - 07:39

On Mon, Apr 15, 2013 at 01:17:19PM +0200, Martin Gräßlin wrote:
That's really trying to twist semantics, IMHO. Polling every five seconds
like it is intended to is not a bug, and now it breaks even worse (by locking
out everyone who change their hostname from their sessions, not just with a
different X setup).

The point of reviews is to catch stupid mistakes like the one Rolf pointed
out (and preferrably have this discussion before-hand, instead of having to
go in and revert stuff).

Re: kded: Disable KHostnameD in KDED

By Sebastian =?utf... at 04/15/2013 - 08:04

On Monday, April 15, 2013 13:39:34 Martin Sandsmark wrote:
Polling every 5 seconds for a file that is rarely changed is a bug. This kind
of thing would nowadays, rightfully, never be accepted.

If this monitoring of the hostname is needed at all, it should be done using
filewatch, not polling.

Re: kded: Disable KHostnameD in KDED

By Martin Sandsmark at 04/15/2013 - 08:18

On Mon, Apr 15, 2013 at 02:04:43PM +0200, Sebastian Kügler wrote:
What functionality does it break?

I'm not saying it's not suboptimal, and it can be solved in better ways, but
I would in no way consider this a bug fix.

Re: kded: Disable KHostnameD in KDED

By Daniel Nicoletti at 04/15/2013 - 09:16

2013/4/15 Martin Sandsmark <martin. ... at kde dot org>:

Re: kded: Disable KHostnameD in KDED

By Rolf Eike Beer at 04/15/2013 - 07:03

Am 15.04.2013 12:43, schrieb Àlex Fiestas:
Nice, now we have

if (bCheckHostname)
kded->initModules();

This can't be right.

Eike