Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Bizarre dbus setting for power-profiles-daemon
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
finoderi
Tux's lil' helper
Tux's lil' helper


Joined: 29 Oct 2021
Posts: 75

PostPosted: Mon Sep 25, 2023 4:26 am    Post subject: Bizarre dbus setting for power-profiles-daemon Reply with quote

Some time ago I've noticed that dbus tries to launch power-profiles-daemon when system starts and fails every time. Finally I decided to figure out what's going on and found what looks like some off coloured joke.

There is a file called 'net.hadess.PowerProfiles.service' in /usr/share/dbus-1/system-services with the following content:
Code:
[D-BUS Service]
Name=net.hadess.PowerProfiles
Exec=/bin/false
User=root
SystemdService=power-profiles-daemon.service


No wander it fails to launch every time. If '/bin/false' is replaced with an actual address (Exec=/usr/libexec/power-profiles-daemon), the service is successfully launched by dbus.

I have two questions: why on Earth dbus even tries to launch this service by default and why its config leads to nowhere?
Apparently those who want this service running at login can add it to the default run level or launch it as usual (with rc-service power-profiles-daemon start). Why start it through dbus and condition it to fail? Should it be fixed?
Back to top
View user's profile Send private message
Banana
Moderator
Moderator


Joined: 21 May 2004
Posts: 1716
Location: Germany

PostPosted: Mon Sep 25, 2023 5:48 am    Post subject: Reply with quote

Even in the official git repo of the package the file does contain the exec false.

So it looks to me it should not be a problem of the file.
_________________
Forum Guidelines

PFL - Portage file list - find which package a file or command belongs to.
My delta-labs.org snippets do expire
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2175

PostPosted: Mon Sep 25, 2023 8:21 am    Post subject: Reply with quote

Interesting. On my OpenRc system the power-profiles-daemon starts without problem
IIUC, the /usr/share/dbus-1/system-service/net.hadess.PowerProfiles.service is a SystemD default configuration to disable the service, which would usually be overwritten by a file somewhere in /etc/systemd/ that would run the executable. AFAICT, if you're running OpenRc, that file is irrelevant, and it's the /etc/init.d/power-profiles-daemon file that starts the service, provided you added it to the default runlevel as documented in the ebuild.
_________________
Greybeard
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1685
Location: South America

PostPosted: Mon Sep 25, 2023 12:24 pm    Post subject: Re: Bizarre dbus setting for power-profiles-daemon Reply with quote

finoderi wrote:
why on Earth dbus even tries to launch this service by default and why its config leads to nowhere?

Because upstream doesn't seemingly care (or know) about anything that isn't systemd. dbus-daemon doesn't launch it by default. It launches it when someone wants to send a message to well-known bus name net.hadess.PowerProfiles, and, with systemd, this line is what actually starts the daemon:

Code:
SystemdService=power-profiles-daemon.service

Exec= is ignored.
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
finoderi
Tux's lil' helper
Tux's lil' helper


Joined: 29 Oct 2021
Posts: 75

PostPosted: Mon Sep 25, 2023 12:57 pm    Post subject: Reply with quote

Thanks to everybody for clarification.
So if someone doesn't use systemd and doesn't need this service, it will fail every time the system boots just because... why not?
Back to top
View user's profile Send private message
GDH-gentoo
Veteran
Veteran


Joined: 20 Jul 2019
Posts: 1685
Location: South America

PostPosted: Mon Sep 25, 2023 1:08 pm    Post subject: Reply with quote

finoderi wrote:
So if someone doesn't use systemd and doesn't need this service, it will fail every time the system boots just because... why not?

If dbus-daemon started the daemon, it is because some process tried to communicate with it, so I would call the "doesn't need this service" into question...
_________________
NeddySeagoon wrote:
I'm not a witch, I'm a retired electronics engineer :)
Ionen wrote:
As a packager I just don't want things to get messier with weird build systems and multiple toolchains requirements though :)
Back to top
View user's profile Send private message
finoderi
Tux's lil' helper
Tux's lil' helper


Joined: 29 Oct 2021
Posts: 75

PostPosted: Mon Sep 25, 2023 1:22 pm    Post subject: Reply with quote

GDH-gentoo wrote:
If dbus-daemon started the daemon, it is because some process tried to communicate with it, so I would call the "doesn't need this service" into question...

I see. I use KDE and dbus-daemon tries to launch power-profiles-daemon even when 'Power management profile' isn't checked in KDE's System Settings. And I haven't found any other setting related to it. Could it be a KDE bug?
Back to top
View user's profile Send private message
Goverp
Advocate
Advocate


Joined: 07 Mar 2007
Posts: 2175

PostPosted: Fri Sep 29, 2023 5:26 pm    Post subject: Reply with quote

finoderi wrote:
Thanks to everybody for clarification.
So if someone doesn't use systemd and doesn't need this service, it will fail every time the system boots just because... why not?

When I installed power-profiles-daemon the emerge log included some instructions. From the ebuild:
Code:
 if [[ -z "${REPLACING_VERSIONS}" ]]; then
                if systemd_is_booted; then
                        elog "You need to enable the service:"
                        elog "# systemctl enable ${PN}"
                else
                        elog "# rc-update add ${PN} default"
                fi
        fi

so it should be in the default runlevel. On my system its status is "started". Whether it's doing anything is a different question :-)
_________________
Greybeard
Back to top
View user's profile Send private message
dmpogo
Advocate
Advocate


Joined: 02 Sep 2004
Posts: 3414
Location: Canada

PostPosted: Sat Jul 20, 2024 7:13 am    Post subject: Reply with quote

Goverp wrote:
finoderi wrote:
Thanks to everybody for clarification.
So if someone doesn't use systemd and doesn't need this service, it will fail every time the system boots just because... why not?

When I installed power-profiles-daemon the emerge log included some instructions. From the ebuild:
Code:
 if [[ -z "${REPLACING_VERSIONS}" ]]; then
                if systemd_is_booted; then
                        elog "You need to enable the service:"
                        elog "# systemctl enable ${PN}"
                else
                        elog "# rc-update add ${PN} default"
                fi
        fi

so it should be in the default runlevel. On my system its status is "started". Whether it's doing anything is a different question :-)




On my Openrc KDE laptop with power management, power-profiles-daemon after installation is not in any rc levels, and is not started
Back to top
View user's profile Send private message
finoderi
Tux's lil' helper
Tux's lil' helper


Joined: 29 Oct 2021
Posts: 75

PostPosted: Sat Jul 20, 2024 12:24 pm    Post subject: Reply with quote

dmpogo wrote:
On my Openrc KDE laptop with power management, power-profiles-daemon after installation is not in any rc levels, and is not started

It's not started but it still tries to start and fails with an error:
Code:
[dbus-daemon] [system] Activated service 'net.hadess.PowerProfiles' failed: Launch helper exited with unknown return code 1
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum