TheAlexDev23 / power-options

Linux GUI application for blazingly fast and simple power-management.
MIT License
233 stars 1 forks source link

Daemon Panic After Initial Install #24

Open theuser18 opened 3 weeks ago

theuser18 commented 3 weeks ago

I am using the Framework laptop 11th gen Intel i5 running a fully updated Fedora 40.

I get the following error when trying to launch the program, even after multiple reboots.

Unexpected error occurred 

- Please make sure that the power-options daemon is running.

- If this is your first time running the app since installing you might need to reboot.

Full panic message:
panicked at crates/frontend-gtk/src/communications/daemon_control.rs:39:56:
called `Result::unwrap()` on an `Err` value: MethodError(OwnedErrorName("org.freedesktop.DBus.Error.ServiceUnknown"), Some("The name is not activatable"), Msg { type: Error, serial: 4294967295, sender: UniqueName("org.freedesktop.DBus"), reply-serial: 2, body: Signature("s"), fds: [] })

The output of journalctl -u power-options is -- No entries --

TheAlexDev23 commented 3 weeks ago

That's really weird, it should have some entries. What's the output of sysremctl status power-options?

theuser18 commented 3 weeks ago

Do you mean systemctl status power-options?

○ power-options.service - power-options daemon
     Loaded: loaded (/usr/lib/systemd/system/power-options.service; disabled; p>
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
TheAlexDev23 commented 3 weeks ago

Yeah sorry for the typo.

It seems like the service was not started. Could you start it/enable it manually with systemctl? Does it output anything then?

theuser18 commented 3 weeks ago
$ systemctl start power-options
$ systemctl status power-options
× power-options.service - power-options daemon
     Loaded: loaded (/usr/lib/systemd/system/power-options.service; disabled; p>
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Wed 2024-10-02 11:47:17 EDT; 8s a>
   Duration: 9ms
    Process: 9664 ExecStart=/usr/bin/power-daemon-mgr daemon (code=exited, stat>
   Main PID: 9664 (code=exited, status=101)
        CPU: 8ms

Oct 02 11:47:17 fedora systemd[1]: Started power-options.service - power-option>
Oct 02 11:47:17 fedora power-daemon-mgr[9664]: thread 'main' panicked at crates>
Oct 02 11:47:17 fedora power-daemon-mgr[9664]: Could not read config: Os { code>
Oct 02 11:47:17 fedora power-daemon-mgr[9664]: note: run with `RUST_BACKTRACE=1>
Oct 02 11:47:17 fedora systemd[1]: power-options.service: Main process exited, >
Oct 02 11:47:17 fedora systemd[1]: power-options.service: Failed with result 'e>
lines 1-16/16 (END)...skipping...
× power-options.service - power-options daemon
     Loaded: loaded (/usr/lib/systemd/system/power-options.service; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Wed 2024-10-02 11:47:17 EDT; 8s ago
   Duration: 9ms
    Process: 9664 ExecStart=/usr/bin/power-daemon-mgr daemon (code=exited, status=101)
   Main PID: 9664 (code=exited, status=101)
        CPU: 8ms

Oct 02 11:47:17 fedora systemd[1]: Started power-options.service - power-options daemon.
Oct 02 11:47:17 fedora power-daemon-mgr[9664]: thread 'main' panicked at crates/power-daemon/src/lib.rs:366:44:
Oct 02 11:47:17 fedora power-daemon-mgr[9664]: Could not read config: Os { code: 2, kind: NotFound, message: "No such file or directory" }
Oct 02 11:47:17 fedora power-daemon-mgr[9664]: note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Oct 02 11:47:17 fedora systemd[1]: power-options.service: Main process exited, code=exited, status=101/n/a
Oct 02 11:47:17 fedora systemd[1]: power-options.service: Failed with result 'exit-code'.
TheAlexDev23 commented 3 weeks ago

Oh yeah, this happens when power options has not been initialized. The copr package was probably made before the migration to the setup system, and given that it is community made, I do not have control over it so I couldn't change the install instructions. It should have ran the following after installing the package sudo power-daemon-mgr setup and then restart power-options. Basically what this script does

TheAlexDev23 commented 3 weeks ago

Temporarily of course, you can still run the commands within setup.sh until the package gets fixed.

theuser18 commented 3 weeks ago

Temporarily of course, you can still run the commands within setup.sh until the package gets fixed.

Would you mind sharing how to do that?

TheAlexDev23 commented 3 weeks ago

Just copy paste the commands in setup.sh into a terminal and you should be good. Especially given that this has to only be run once for the first time power-options is installed any further updates will not require this.

theuser18 commented 3 weeks ago

Just copy paste the commands in setup.sh into a terminal and you should be good. Especially given that this has to only be run once for the first time power-options is installed any further updates will not require this.

This worked. Thanks!

lpuv commented 15 hours ago

@theuser18 Apologies, this completely flew under the radar. Will get to it

lpuv commented 15 hours ago

@TheAlexDev23 Unfortunately according to Fedora's policies the package is not allowed to enable itself. I can still package it to do that, but then it would not go into official repos ever. The recommended way would be to simply add sudo systemctl enable --now power-options to the installation instructions after installing the RPM. Additionally, the setup command will not work, it needs to be added to the install instructions.

sudo dnf copr enable leo/power-options 
sudo dnf install power-options
sudo power-daemon-mgr setup
sudo systemctl enable --now power-options

Let me know what you think!

TheAlexDev23 commented 14 hours ago

@lpuv, how much does Fedora restrict the execution of setup commands? power-daemon-mgr setup only generates config files. The settings are only applied by the daemon which obviously only runs if started by the user. Altough it does gather system info, which might have restrictions? I've added the custom sysroot parameter, tell me if other parameters are required, but I assume /etc (which is the only folder the setup command writes to) does not have the ambiguity problem that /bin, /usr/bin or /usr/local/bin does.

lpuv commented 12 hours ago

After thinking about it, the issue is that some of the setup (generating config) would need to be run by the user anyway as it could not be run on Fedora's build servers. The biggest thing is that since none of the packaging is done on the target machine of the user it can't do any real setup.

TheAlexDev23 commented 5 hours ago

Yeah, its meant to be ran on the installed system. Does fedora or the RPM package not allow post install scriplets?