hyprwm / hypridle

Hyprland's idle daemon
BSD 3-Clause "New" or "Revised" License
404 stars 25 forks source link

[CRITICAL] Couldn't connect to logind service ([System.Error.EISDIR] Is a directory) #78

Closed schatderer closed 4 months ago

schatderer commented 4 months ago

I'm trying to run hyridle with hyperland window manager, but I'm not succeeding, as I always come across the message below:

'[CRITICAL] Couldn't connect to logind service ([System.Error.EISDIR] Is a directory)'

Attached is the log file when I try to run the program.

NOTE: The Linux distribution I use is Gentoo, with OpenRC as service manager (and not SystemD). Hyprland requires the seatd software to start - I've already compiled it without and with elogind support, but I keep encountering this error.

hypridle.log

gnusenpai commented 4 months ago

Have you added the elogind service to the boot runlevel? Also, running seatd isn't required if logind is running, but it does require the elogind flag.

schatderer commented 4 months ago

Yes, elogind had already been placed in the boot runlevel.

Anyway, I finally managed to solve the problem by trying to understand everything that was involved:

1) Initially I wanted to use Hyprland without elogind. I was able to use it normally, but I couldn't get hypridle to work.

2) So I tried using Hyprland with elogind, but I still couldn't get hypridle to work (which motivated me to report this here).

3) I then realized that, even with elogind, I had to do something manually (via shell script) that should be automatic: creating the XDG_RUNTIME_DIR environment.

4) I then discovered that sys-apps/shadow was compiled without the PAM flag (but elogind was). This is necessary for the automatic creation of the XDG_RUNTIME_DIR environment.

5) Although seatd is a dependency on Hyprland, it does not need to be run if elogind is being used, as long as polkit is compiled with the daemon flag (and obviously seatd compiled with the elogind flag).

Having done all this, everything is working now.

Out of curiosity, I would just like to know if it would be possible to use hypridle without elogind and polkit, that is, only with seatd. Would some environment variable have to be prepared for hypridle to recognize libseat without elogind? I reinforce again that without elogind I couldn't make it work.

gnusenpai commented 4 months ago

Out of curiosity, I would just like to know if it would be possible to use hypridle without elogind and polkit, that is, only with seatd.

This is what I am doing currently, using seatd (the daemon) and turnstile. I recently had a PR merged (#76) that makes logind optional.

Alternatively to turnstile, you can use pam_rundir to set XDG_RUNTIME_DIR. I have ebuilds for both in my overlay if you want to have a look.

schatderer commented 4 months ago

I installed turnstile and recompiled seatd without elogind (in fact I removed this flag from the entire system, thus being able to remove elogind and polkitd).

I added turnstiled to the boot runlevel and seatd to the default runlevel.

The XDG_RUNTIME_DIR environment is automatically prepared by turnstiled and Hyprland runs normally (with the help of seatd).

However, when I run hypridle, I now encounter the following error:

[CRITICAL] Couldn't connect to logind service ([org.freedesktop.DBus.Error.ServiceUnknown] The name org.freedesktop.login1 was not provided by any .service files)

gnusenpai commented 4 months ago

You currently either need to run the main version of hypridle until the next release or patch v0.1.2 with 76.txt

(Put the above file at /etc/portage/patches/gui-apps/hypridle-0.1.2/76.patch)

A side note, not really important: turnstiled is fine in the default runlevel.

schatderer commented 4 months ago

Thank you very much, it worked with the patch: hyprland and hypridle without elogind and polkitd.