Bug 173633 - powerdevil is activated by default
Summary: powerdevil is activated by default
Status: RESOLVED FIXED
Alias: None
Product: solid
Classification: Unmaintained
Component: powermanagement-daemon (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Dario Freddi
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-26 21:13 UTC by fullmetalcoder
Modified: 2010-10-02 12:49 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fullmetalcoder 2008-10-26 21:13:10 UTC
Version:            (using Devel)
Compiler:          GCC 4.2.4 
OS:                Linux
Installed from:    Compiled sources

I have reported an issues about PowerDevil default behavior in another bug but while I tested this issue and thanks to the explanation of a dev I discovered that launching a KDE 4 app without actually starting a full session causes a lot of daemons/services to be launched.

For instance I started Amarok from my command line (within a KDE 3 session) and it caused kded, ksycoca, powerdevil (and probably other stuff as well but those were easier to spot due to the way they flooded my command line or altered my brightness settings (powerdevil)).

What's obviously wrong is that some daemons/services do NOT need to be launched everytime a KDE 4 application is started. kded, ksycoca and some others make sense but if things like powerdevil are automatically started out of a full session then there are probably many others and this is just plain wrong for two main reasons :
 * some of these may interact in unwanted ways with the running desktop environment (as it happened for me with PowerDevil)
 * every such daemon/service it is an utter waste of system resources because the launched application does not require it

My use case may not seem relevant but please consider that there are many people that often use a couple of KDE 3 applications from another DE (Amarok and K3B are good examples) and this behavior is likely to remain for their KDE 4 equivalent (and might even increase considering the opinion some long-time KDE 3 users have about KDE 4).
Comment 1 Pino Toscano 2008-10-26 21:33:05 UTC
Most of the stuff actually IS needed, like kded (the kde daemon, for things like cookies in konqueror and other services), kdeinit (for launching kde applications), klauncher (for launching kioslaves such as file, http, ftp, etc).
ksyscoca is not a daemon, but it is the kde system configuration cache, a rebuild of whose is triggered whenever a .desktop file in the KDE directories is changed.

Each of it has a particular purpouse, and even it looks a waste for single applications, it is a real memory and performance gain when more than one KDE application is running.

Sorry, but there is nothing wrong in KDE's work.
Comment 2 fullmetalcoder 2008-10-26 21:57:33 UTC
Tragic misunderstanding... I thought I was clear, it looks like I made a mess of it :

I DO know that kded/kdeinit/ksycoca are NEEDED by all KDE applications.

I DO know that PowerDevil (and any other services that may be launched by kded (or whathever end up launching them, I just blame kded right now because someone told me it was responsible for launching PowerDevil) is NOT needed by ANY KDE application.

I thus beg you to prevent all the notoriously useless services/daemons from being run outside of a KDE 4 session.

Note : I do not mean that the aforementioned services/daemons are useless in general but rather that they are useless in the particular case of launching a single KDE 4 application from a non-KDE session and as such should not be launched unless it becomes necessary (which should never be the case for PowerDevil for instance, especially not when I simply launch Amarok...).

I hope I made my point a little clearer.

kind regards

fullmetalcoder
Comment 3 Pino Toscano 2008-10-26 22:17:27 UTC
If you would have read what I said, then you knew some of them are *necessary* for any KDE application.
The fact that you run them as single applications or or within a complete session does not matter at all, the are *always* useful for a purpouse.

You want Amarok to download something from the Internet? Then you *need* kded+kdeinit4+klauncher4, even if it is the only KDE 4 application running.
And if for Amarok they are started at its startup, then it means Amarok *needs* them, you want to accept that or not.

You assumptions are simply based on the missing of information on your side on those services. Do not assume they are useful just because you see more than one application running when you request one.
Comment 4 fullmetalcoder 2008-10-26 22:33:06 UTC
I'm sorry if I'm about to sound rude but it looks like there's no other way of getting the message accross...

1) If YOU would have CAREFULLY read what I wrote you would probably have spotted that I fully understand the need for SOME services to be launched and you would not have to repeat that over and over.

2) If YOU would have CAREFULLY read what I wrote you would probably have spotted that I precisely mentioned one service that NEED NOT being launched, regardless of the app that was launched in the first place : PowerDevil.

The reason I mention this one is because PowerDevil is causing some troubles on my laptop (adjusting brightness when it should not, based on the wrong assumption that I'm running on battery) and it makes it quite clear that this particular service is launched everytime a KDE 4 apps is started from my KDE 3 session.

If you have any VALID reason to launch services such as PowerDevil outside of a KDE 4 session for every single KDE 4 apps being started please explain them. Otherwise please consider accepting that this really is a bug which can (and in my precise case does) induce unwanted interactions with the running session or unwanted hardware settings change.

The system resource waste I mentioned does not affect me but it really could become an issue as KDE 4 will grow and more such services will be added, especially on lower end hardware (my laptop has rather good specs overall).

kind regards

fullmetalcoder

p.s : I mean no offence but, please, read the whole sentences this time before answering and marking this bug report as invalid...
Comment 5 Pino Toscano 2008-10-26 22:41:07 UTC
Then why don't just says "why powerdevil is activated by default" instead of your rant about "kde services and other stuff"?
Complaining about the whole system is stupid, especially when your problem is just with one service that you just quote as "academic example".

> If you have any VALID reason to launch services

If they are launched, there *are* reasons.

Anyway, reassigning to the PowerDevil maintainer, have fun with him.
Comment 6 Dario Freddi 2008-10-26 22:51:36 UTC
Ok, this is rather simple: should I disable it by default, I'll get rants from every laptop user saying "Why it is not enabled by default". I have no problems in disabling it, though thinking about how many people are already using it, I don't think this is a great idea.

You can easily disable it in services if you don't want it, but again, if you log into KDE4 you'll probably want it available, and so here we go again. This case is rather uncommon, and again, I can't make a choice that covers each user case, and the current one clearly covers the largest part of user cases, since almost every user is happy with powerdevil enabled by default.
Comment 7 fullmetalcoder 2008-10-26 22:55:19 UTC
If merely trying to point out bugs is ranting then, yes, I'm ranting because I'm interested in KDE 4 getting better.

PowerDevil is indead just an academic example and complaining about kded (or whatever other part of KDE is responsible for launching PowerDevil in this case) makes a lo of sense because it is up to it to decide whether or not a give nservice should be started, and to not up to that service to determine whether its existence is worth it and it should commit suicide...

I have not investigated the issue because I do lack knowledge about KDE 4 internals right now and can'y guess where the offending code lies, or I'd have come with a patch, but if PowerDevil is launched it is likely that it is not the only unnecessary service to be launched.

For your information I started talking about this problem in the brightness bug I mentioned above and this answer came :

> I can't comment about the KDED stuff, though I recognize it isn't really nice to have a lot of services loaded just when you want to open an application, but I think this should be discussed in a separate bug.

See this bug for more informations (and why reassigning to PowerDevil maintainer makes little, if any, sense) : http://bugs.kde.org/show_bug.cgi?id=173518
Comment 8 fullmetalcoder 2008-10-26 23:00:33 UTC
@Dario :

this is indeed rather simple but more like that :

there should be a way for services to explain that they need not be launched outside a full KDE session and kded (or whatever piece of code is in charge of launching services) would just have to honor this hint by checking whether a full KDE session is running or just a single application.

If anyone is willing to give me some pointers to the relevant pieces of code I can take some time and make a patch if nobody else is interested in getting this done.
Comment 9 Pino Toscano 2008-10-26 23:15:25 UTC
You still did not say what is this "crowd of kded modules" being run by default. kded has a feature of loading modules when needed, and most of the modules are like this.
In my current kde 4.2 installation, running two kde4 applications (okular and kopete) outside a kde4 session gives a kded with those modules loaded:
kdedglobalaccel, networkstatus, powerdevil, ktimezoned
excluding powerdevil, all the other ones were loaded on demand by request of the applications.
THe fact that they are loaded within kded amkes them "cheap" in terms of memory usage too.
Comment 10 fullmetalcoder 2008-10-27 15:06:33 UTC
I'm not saying there is a crowd. I'm pointing out that there is at least one unneeded module loaded. If, as you're saying, it happens to be the only one in this case there two possible reasons :

1) either there already exist something similar to the "load me only if strictly needed" hint and PowerDevil does not use it (bad and probably extremely easy to fix)
2) or there are no such mechanism and PowerDevil is the only unneeded module to be loaded because it is the only potentially unneeded module that may be loaded right now (equally bad and probably a little trickier to fix but doable anyway)

Either ways there still is a problem. While it may look like a detail it is one that can bother people (it does bother me at least) and should be fixed. I understand that it is not a top-priority item and that's why I'm willing to help if it is needed. But for this I would need a couple of pointers to the relevant pieces of code and I'd also need to know which of the two above scenario happens.

kind regards
Comment 11 Dario Freddi 2009-01-18 12:58:11 UTC
Now PowerDevil loads only upon starting a KDE4 session, so I'm marking this as fixed