openSUSE / openSUSEway

dotfiles for Sway on openSUSE
MIT License
92 stars 17 forks source link

greetd couldn't find pam.d and potentially its own config file in /usr/etc/ #33

Closed denisok closed 2 years ago

denisok commented 3 years ago

I have tried to package greetd in a little bit new way, by adding pam.d to %{_distconfdir}/pam.d/greetd line 92.

That should put it on /usr/etc/pam.d instead of /etc/ that is a part of UsrEtc packaging guideline: https://en.opensuse.org/openSUSE:Packaging_UsrEtc .

I left conf still in etc for some reason.

But actually greetd checks for the absolute path both for the conf and pam.d : https://git.sr.ht/~kennylevinsen/greetd/tree/master/item/greetd/src/server.rs#L191 https://git.sr.ht/~kennylevinsen/greetd/tree/master/item/greetd/src/config/mod.rs#L242

which means that it will error out. Workaround is to link /etc/pam.d/greetd to /usr/etc/pam.d/greetd .

For pam it is not clear to me yet, there was a patch for Vendor dirs so PAM itself could find needed files, but rust code and libs in greetd use absolute path.

For the conf file there are couple of ways:

denisok commented 3 years ago

https://bugzilla.opensuse.org/show_bug.cgi?id=1182554

thkukuk commented 3 years ago

Never ever hardcode fix paths in tools which are different or incomplete compared to what the low level libraries are using. Linux-PAM is using and looking in more paths than just /etc/pam.d and /usr/etc/pam.d and they are all supported by us.

denisok commented 3 years ago

@thkukuk I might agree, but I am not a tool dev. I wait for some time to see how they implemented it in the tool with Rust and why they use fixed pass...

denisok commented 3 years ago

@thkukuk when you already here :) please suggest what is the right path for the conf file. I listed those options: For the conf file there are couple of ways:

easiest: fix spec to still place to /etc/
easy: just add additional path /usr/etc
harder: add libeconf support

what will be the right one, or maybe there is another one? How I could check from the system if there is vendor path or not for the /etc ? During packaging and then pass it as param to the build ?

thkukuk commented 3 years ago

Mid- to long term, no package will be allowed to ship with files in /etc, /etc should only be for host specific files and admin changes. Not only openSUSE, but also systemd and others are working in that direction and some Linux distributions have already finished this job. There is no "final" place in /usr yet, some packages use /usr/{lib,share}/package.d/ or something similar (but sysadmins don't like that), some use /usr/share/basesystem (does not fit FHS in all cases)... So as minimum, I would use a configureable "vendordir" or "distconfdir", and if the config file does not exist in /etc, use that (like /usr/etc).

kennylevinsen commented 3 years ago

Never ever hardcode fix paths in tools which are different or incomplete compared to what the low level libraries are using.

I believe a PAM documentation bug is the source of the issue here. From pam_start(3):

The service_name argument specifies the name of the service to apply and will be stored as PAM_SERVICE item in the new context. The policy for the service will be read from the file /etc/pam.d/service_name or, if that file does not exist, from /etc/pam.conf.

The check for /etc/pam.d/greetd was implemented based on the above, which does indeed appear inconsistent with pam(8), which makes mention of /usr/lib/pam.d and vendor-specific folders. This test is for obvious reasons unaware of compile-time specified PAM vendor dirs, such as the (currently) non-standard /usr/etc.

It should also be noted that the check was meant to be temporary, as greetd early on just used the login service, with the check made to not blow existing installs up.

@denisok Could I get you to open an issue against greetd?

denisok commented 3 years ago

@kennylevinsen will do.

denisok commented 3 years ago

upstream issues: pam.d: https://todo.sr.ht/~kennylevinsen/greetd/19 conf: https://todo.sr.ht/~kennylevinsen/greetd/20

mcepl commented 3 years ago

Hmm, still not getting it working. journalctl-failed-log.txt

denisok commented 3 years ago

@mcepl are you able to reproduce it on VM ? What is your current /etc/greetd/config.toml ?

mcepl commented 3 years ago

No time to play with VM.

I believe /etc/greetd/config.toml is the one from openSUSEway package:

~@stitny$ cat /etc/greetd/config.toml
[terminal]
# The VT to run the greeter on. Can be "next", "current" or a number
# designating the VT.
vt = 1

# The default session, also known as the greeter.
[default_session]

# `agreety` is the bundled agetty/login-lookalike. You can replace `$SHELL`
# with whatever you want started, such as `sway`.
#
command = "sway --config /etc/greetd/sway-config"

# The user to run the command as. The privileges this user must have depends
# on the greeter. A graphical greeter may for example require the user to be
# in the `video` group.
user = "greeter"
~@stitny$

and yes /etc/greetd/sway-config as well:

~@stitny$ cat /etc/greetd/sway-config
exec "gtkgreet -l; swaymsg exit"

bindsym Mod4+shift+e exec swaynag \
    -t warning \
    -m 'What do you want to do?' \
    -b 'Poweroff' 'systemctl poweroff' \
    -b 'Reboot' 'systemctl reboot'

#include /etc/sway/config.d/*
~@stitny$
denisok commented 3 years ago

@mcepl I tried to setup and reproduce, but I can't. The only difference I see : #include /etc/sway/config.d/* I don't have * at the end in my config file. Before we had issue #10, and I thought maybe you have some bad file in the dir, but I placed some and it still works.

could you please change config.toml with this: command = "sway -d --config /etc/greetd/sway-config 2>/tmp/sway.log" and see if there is something in that log that could give us a hint.

mcepl commented 3 years ago

вот ни черта не понимаю

sway.log

denisok commented 3 years ago

@kennylevinsen could you please help us to understand logs that were attached above ?

@mcepl just in case, could you provide output zypper se -s gtk-layer-shell sway wlr

mcepl commented 3 years ago
tmp@stitny$ LANG=en_GB sudo zypper se -s gtk-layer-shell sway wlr
Loading repository data...
Reading installed packages...

S  | Name                               | Type       | Version      | Arch   | Repository
---+------------------------------------+------------+--------------+--------+----------------------------------------
   | gtk-layer-shell                    | srcpackage | 0.6.0-1.3    | noarch | Hlavní repozitář (zdroje)
   | gtk-layer-shell-debugsource        | package    | 0.6.0-1.3    | x86_64 | openSUSE-Tumbleweed-Debug
   | gtk-layer-shell-debugsource        | package    | 0.6.0-1.3    | i586   | openSUSE-Tumbleweed-Debug
i+ | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | x86_64 | openSUSE:Tumbleweed
i+ | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | x86_64 | openSUSE:Factory
i+ | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | x86_64 | openSUSE-20180513-0
i+ | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | x86_64 | openSUSE-Tumbleweed-Oss
v  | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | i586   | openSUSE:Tumbleweed
v  | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | i586   | openSUSE:Factory
v  | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | i586   | openSUSE-20180513-0
v  | gtk-layer-shell-devel              | package    | 0.6.0-1.3    | i586   | openSUSE-Tumbleweed-Oss
i  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | x86_64 | openSUSE:Tumbleweed
i  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | x86_64 | openSUSE:Factory
i  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | x86_64 | openSUSE-20180513-0
i  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | x86_64 | openSUSE-Tumbleweed-Oss
v  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | i586   | openSUSE:Tumbleweed
v  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | i586   | openSUSE:Factory
v  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | i586   | openSUSE-20180513-0
v  | libgtk-layer-shell0                | package    | 0.6.0-1.3    | i586   | openSUSE-Tumbleweed-Oss
   | libgtk-layer-shell0-debuginfo      | package    | 0.6.0-1.3    | x86_64 | openSUSE-Tumbleweed-Debug
   | libgtk-layer-shell0-debuginfo      | package    | 0.6.0-1.3    | i586   | openSUSE-Tumbleweed-Debug
i  | libwlroots8                        | package    | 0.13.0-1.1   | x86_64 | openSUSE:Tumbleweed
i  | libwlroots8                        | package    | 0.13.0-1.1   | x86_64 | openSUSE:Factory
i  | libwlroots8                        | package    | 0.13.0-1.1   | x86_64 | openSUSE-20180513-0
i  | libwlroots8                        | package    | 0.13.0-1.1   | x86_64 | openSUSE-Tumbleweed-Oss
v  | libwlroots8                        | package    | 0.13.0-1.1   | i586   | openSUSE:Tumbleweed
v  | libwlroots8                        | package    | 0.13.0-1.1   | i586   | openSUSE:Factory
v  | libwlroots8                        | package    | 0.13.0-1.1   | i586   | openSUSE-20180513-0
v  | libwlroots8                        | package    | 0.13.0-1.1   | i586   | openSUSE-Tumbleweed-Oss
   | libwlroots8-debuginfo              | package    | 0.13.0-1.1   | x86_64 | openSUSE-Tumbleweed-Debug
   | libwlroots8-debuginfo              | package    | 0.13.0-1.1   | i586   | openSUSE-Tumbleweed-Debug
   | patterns-sway                      | srcpackage | 20200619-3.2 | noarch | Hlavní repozitář (zdroje)
i  | patterns-sway-sway                 | package    | 20200619-3.2 | x86_64 | openSUSE:Tumbleweed
i  | patterns-sway-sway                 | package    | 20200619-3.2 | x86_64 | openSUSE:Factory
i  | patterns-sway-sway                 | package    | 20200619-3.2 | x86_64 | openSUSE-20180513-0
i  | patterns-sway-sway                 | package    | 20200619-3.2 | x86_64 | openSUSE-Tumbleweed-Oss
v  | patterns-sway-sway                 | package    | 20200619-3.2 | i586   | openSUSE:Tumbleweed
v  | patterns-sway-sway                 | package    | 20200619-3.2 | i586   | openSUSE:Factory
v  | patterns-sway-sway                 | package    | 20200619-3.2 | i586   | openSUSE-20180513-0
v  | patterns-sway-sway                 | package    | 20200619-3.2 | i586   | openSUSE-Tumbleweed-Oss
i+ | sway                               | package    | 1.6-1.2      | x86_64 | openSUSE:Tumbleweed
i+ | sway                               | package    | 1.6-1.2      | x86_64 | openSUSE:Factory
i+ | sway                               | package    | 1.6-1.2      | x86_64 | openSUSE-20180513-0
i+ | sway                               | package    | 1.6-1.2      | x86_64 | openSUSE-Tumbleweed-Oss
v  | sway                               | package    | 1.6-1.2      | i586   | openSUSE:Tumbleweed
v  | sway                               | package    | 1.6-1.2      | i586   | openSUSE:Factory
v  | sway                               | package    | 1.6-1.2      | i586   | openSUSE-20180513-0
v  | sway                               | package    | 1.6-1.2      | i586   | openSUSE-Tumbleweed-Oss
i  | sway                               | pattern    | 20200619-3.2 | x86_64 | openSUSE:Tumbleweed
i  | sway                               | pattern    | 20200619-3.2 | x86_64 | openSUSE:Factory
i  | sway                               | pattern    | 20200619-3.2 | x86_64 | openSUSE-20180513-0
i  | sway                               | pattern    | 20200619-3.2 | x86_64 | openSUSE-Tumbleweed-Oss
v  | sway                               | pattern    | 20200619-3.2 | i586   | openSUSE:Tumbleweed
v  | sway                               | pattern    | 20200619-3.2 | i586   | openSUSE:Factory
v  | sway                               | pattern    | 20200619-3.2 | i586   | openSUSE-20180513-0
v  | sway                               | pattern    | 20200619-3.2 | i586   | openSUSE-Tumbleweed-Oss
   | sway                               | srcpackage | 1.6-1.2      | noarch | Hlavní repozitář (zdroje)
i+ | sway-branding-openSUSE             | package    | 0.13-3.1     | noarch | openSUSE:Tumbleweed
i+ | sway-branding-openSUSE             | package    | 0.13-3.1     | noarch | openSUSE:Factory
i+ | sway-branding-openSUSE             | package    | 0.13-3.1     | noarch | openSUSE-20180513-0
i+ | sway-branding-openSUSE             | package    | 0.13-3.1     | noarch | openSUSE-Tumbleweed-Oss
   | sway-branding-upstream             | package    | 1.6-1.2      | noarch | openSUSE:Tumbleweed
   | sway-branding-upstream             | package    | 1.6-1.2      | noarch | openSUSE:Factory
   | sway-branding-upstream             | package    | 1.6-1.2      | noarch | openSUSE-20180513-0
   | sway-branding-upstream             | package    | 1.6-1.2      | noarch | openSUSE-Tumbleweed-Oss
   | sway-contrib                       | package    | 1.6-1.2      | x86_64 | openSUSE:Tumbleweed
   | sway-contrib                       | package    | 1.6-1.2      | x86_64 | openSUSE:Factory
   | sway-contrib                       | package    | 1.6-1.2      | x86_64 | openSUSE-20180513-0
   | sway-contrib                       | package    | 1.6-1.2      | x86_64 | openSUSE-Tumbleweed-Oss
   | sway-contrib                       | package    | 1.6-1.2      | i586   | openSUSE:Tumbleweed
   | sway-contrib                       | package    | 1.6-1.2      | i586   | openSUSE:Factory
   | sway-contrib                       | package    | 1.6-1.2      | i586   | openSUSE-20180513-0
   | sway-contrib                       | package    | 1.6-1.2      | i586   | openSUSE-Tumbleweed-Oss
   | sway-debuginfo                     | package    | 1.6-1.2      | x86_64 | openSUSE-Tumbleweed-Debug
   | sway-debuginfo                     | package    | 1.6-1.2      | i586   | openSUSE-Tumbleweed-Debug
   | sway-debugsource                   | package    | 1.6-1.2      | x86_64 | openSUSE-Tumbleweed-Debug
   | sway-debugsource                   | package    | 1.6-1.2      | i586   | openSUSE-Tumbleweed-Debug
i+ | sway-marker                        | package    | 0.1-1.1      | x86_64 | Packages for work (openSUSE_Tumbleweed)
v  | sway-marker                        | package    | 0.1-1.1      | i586   | Packages for work (openSUSE_Tumbleweed)
   | sway-marker                        | srcpackage | 0.1-1.1      | noarch | Packages for work (openSUSE_Tumbleweed)
i+ | sway-marker-debuginfo              | package    | 0.1-1.1      | x86_64 | Packages for work (openSUSE_Tumbleweed)
v  | sway-marker-debuginfo              | package    | 0.1-1.1      | i586   | Packages for work (openSUSE_Tumbleweed)
i  | swaybg                             | package    | 1.0-2.7      | x86_64 | openSUSE:Tumbleweed
i  | swaybg                             | package    | 1.0-2.7      | x86_64 | openSUSE:Factory
i  | swaybg                             | package    | 1.0-2.7      | x86_64 | openSUSE-20180513-0
i  | swaybg                             | package    | 1.0-2.7      | x86_64 | openSUSE-Tumbleweed-Oss
v  | swaybg                             | package    | 1.0-2.7      | i586   | openSUSE:Tumbleweed
v  | swaybg                             | package    | 1.0-2.7      | i586   | openSUSE:Factory
v  | swaybg                             | package    | 1.0-2.7      | i586   | openSUSE-20180513-0
v  | swaybg                             | package    | 1.0-2.7      | i586   | openSUSE-Tumbleweed-Oss
   | swaybg                             | srcpackage | 1.0-2.7      | noarch | Hlavní repozitář (zdroje)
   | swaybg-debuginfo                   | package    | 1.0-2.7      | x86_64 | openSUSE-Tumbleweed-Debug
   | swaybg-debuginfo                   | package    | 1.0-2.7      | i586   | openSUSE-Tumbleweed-Debug
   | swaybg-debugsource                 | package    | 1.0-2.7      | x86_64 | openSUSE-Tumbleweed-Debug
   | swaybg-debugsource                 | package    | 1.0-2.7      | i586   | openSUSE-Tumbleweed-Debug
i  | swayidle                           | package    | 1.6-1.7      | x86_64 | openSUSE:Tumbleweed
i  | swayidle                           | package    | 1.6-1.7      | x86_64 | openSUSE:Factory
i  | swayidle                           | package    | 1.6-1.7      | x86_64 | openSUSE-20180513-0
i  | swayidle                           | package    | 1.6-1.7      | x86_64 | openSUSE-Tumbleweed-Oss
v  | swayidle                           | package    | 1.6-1.7      | i586   | openSUSE:Tumbleweed
v  | swayidle                           | package    | 1.6-1.7      | i586   | openSUSE:Factory
v  | swayidle                           | package    | 1.6-1.7      | i586   | openSUSE-20180513-0
v  | swayidle                           | package    | 1.6-1.7      | i586   | openSUSE-Tumbleweed-Oss
   | swayidle                           | srcpackage | 1.6-1.7      | noarch | Hlavní repozitář (zdroje)
   | swayidle-bash-completion           | package    | 1.6-1.7      | noarch | openSUSE:Tumbleweed
   | swayidle-bash-completion           | package    | 1.6-1.7      | noarch | openSUSE:Factory
   | swayidle-bash-completion           | package    | 1.6-1.7      | noarch | openSUSE-20180513-0
   | swayidle-bash-completion           | package    | 1.6-1.7      | noarch | openSUSE-Tumbleweed-Oss
   | swayidle-debuginfo                 | package    | 1.6-1.7      | x86_64 | openSUSE-Tumbleweed-Debug
   | swayidle-debuginfo                 | package    | 1.6-1.7      | i586   | openSUSE-Tumbleweed-Debug
   | swayidle-debugsource               | package    | 1.6-1.7      | x86_64 | openSUSE-Tumbleweed-Debug
   | swayidle-debugsource               | package    | 1.6-1.7      | i586   | openSUSE-Tumbleweed-Debug
   | swayidle-fish-completion           | package    | 1.6-1.7      | noarch | openSUSE:Tumbleweed
   | swayidle-fish-completion           | package    | 1.6-1.7      | noarch | openSUSE:Factory
   | swayidle-fish-completion           | package    | 1.6-1.7      | noarch | openSUSE-20180513-0
   | swayidle-fish-completion           | package    | 1.6-1.7      | noarch | openSUSE-Tumbleweed-Oss
   | swayidle-zsh-completion            | package    | 1.6-1.7      | noarch | openSUSE:Tumbleweed
   | swayidle-zsh-completion            | package    | 1.6-1.7      | noarch | openSUSE:Factory
   | swayidle-zsh-completion            | package    | 1.6-1.7      | noarch | openSUSE-20180513-0
   | swayidle-zsh-completion            | package    | 1.6-1.7      | noarch | openSUSE-Tumbleweed-Oss
i  | swaylock                           | package    | 1.5-1.8      | x86_64 | openSUSE:Tumbleweed
i  | swaylock                           | package    | 1.5-1.8      | x86_64 | openSUSE:Factory
i  | swaylock                           | package    | 1.5-1.8      | x86_64 | openSUSE-20180513-0
i  | swaylock                           | package    | 1.5-1.8      | x86_64 | openSUSE-Tumbleweed-Oss
v  | swaylock                           | package    | 1.5-1.8      | i586   | openSUSE:Tumbleweed
v  | swaylock                           | package    | 1.5-1.8      | i586   | openSUSE:Factory
v  | swaylock                           | package    | 1.5-1.8      | i586   | openSUSE-20180513-0
v  | swaylock                           | package    | 1.5-1.8      | i586   | openSUSE-Tumbleweed-Oss
   | swaylock                           | srcpackage | 1.5-1.8      | noarch | Hlavní repozitář (zdroje)
   | swaylock-bash-completion           | package    | 1.5-1.8      | noarch | openSUSE:Tumbleweed
   | swaylock-bash-completion           | package    | 1.5-1.8      | noarch | openSUSE:Factory
   | swaylock-bash-completion           | package    | 1.5-1.8      | noarch | openSUSE-20180513-0
   | swaylock-bash-completion           | package    | 1.5-1.8      | noarch | openSUSE-Tumbleweed-Oss
   | swaylock-debuginfo                 | package    | 1.5-1.8      | x86_64 | openSUSE-Tumbleweed-Debug
   | swaylock-debuginfo                 | package    | 1.5-1.8      | i586   | openSUSE-Tumbleweed-Debug
   | swaylock-debugsource               | package    | 1.5-1.8      | x86_64 | openSUSE-Tumbleweed-Debug
   | swaylock-debugsource               | package    | 1.5-1.8      | i586   | openSUSE-Tumbleweed-Debug
   | swaylock-fish-completion           | package    | 1.5-1.8      | noarch | openSUSE:Tumbleweed
   | swaylock-fish-completion           | package    | 1.5-1.8      | noarch | openSUSE:Factory
   | swaylock-fish-completion           | package    | 1.5-1.8      | noarch | openSUSE-20180513-0
   | swaylock-fish-completion           | package    | 1.5-1.8      | noarch | openSUSE-Tumbleweed-Oss
   | swaylock-zsh-completion            | package    | 1.5-1.8      | noarch | openSUSE:Tumbleweed
   | swaylock-zsh-completion            | package    | 1.5-1.8      | noarch | openSUSE:Factory
   | swaylock-zsh-completion            | package    | 1.5-1.8      | noarch | openSUSE-20180513-0
   | swaylock-zsh-completion            | package    | 1.5-1.8      | noarch | openSUSE-Tumbleweed-Oss
   | wlr-randr                          | package    | 0.2.0-1.4    | x86_64 | openSUSE:Tumbleweed
   | wlr-randr                          | package    | 0.2.0-1.4    | x86_64 | openSUSE:Factory
   | wlr-randr                          | package    | 0.2.0-1.4    | x86_64 | openSUSE-20180513-0
   | wlr-randr                          | package    | 0.2.0-1.4    | x86_64 | openSUSE-Tumbleweed-Oss
   | wlr-randr                          | package    | 0.2.0-1.4    | i586   | openSUSE:Tumbleweed
   | wlr-randr                          | package    | 0.2.0-1.4    | i586   | openSUSE:Factory
   | wlr-randr                          | package    | 0.2.0-1.4    | i586   | openSUSE-20180513-0
   | wlr-randr                          | package    | 0.2.0-1.4    | i586   | openSUSE-Tumbleweed-Oss
   | wlr-randr                          | srcpackage | 0.2.0-1.4    | noarch | Hlavní repozitář (zdroje)
   | wlr-randr-debuginfo                | package    | 0.2.0-1.4    | x86_64 | openSUSE-Tumbleweed-Debug
   | wlr-randr-debuginfo                | package    | 0.2.0-1.4    | i586   | openSUSE-Tumbleweed-Debug
   | wlr-randr-debugsource              | package    | 0.2.0-1.4    | x86_64 | openSUSE-Tumbleweed-Debug
   | wlr-randr-debugsource              | package    | 0.2.0-1.4    | i586   | openSUSE-Tumbleweed-Debug
i+ | wlr-sunclock                       | package    | 0.1.1-1.6    | x86_64 | openSUSE:Tumbleweed
i+ | wlr-sunclock                       | package    | 0.1.1-1.6    | x86_64 | openSUSE:Factory
i+ | wlr-sunclock                       | package    | 0.1.1-1.6    | x86_64 | openSUSE-20180513-0
i+ | wlr-sunclock                       | package    | 0.1.1-1.6    | x86_64 | openSUSE-Tumbleweed-Oss
v  | wlr-sunclock                       | package    | 0.1.1-1.6    | i586   | openSUSE:Tumbleweed
v  | wlr-sunclock                       | package    | 0.1.1-1.6    | i586   | openSUSE:Factory
v  | wlr-sunclock                       | package    | 0.1.1-1.6    | i586   | openSUSE-20180513-0
v  | wlr-sunclock                       | package    | 0.1.1-1.6    | i586   | openSUSE-Tumbleweed-Oss
   | wlr-sunclock                       | srcpackage | 0.1.1-1.6    | noarch | Hlavní repozitář (zdroje)
   | wlr-sunclock-debuginfo             | package    | 0.1.1-1.6    | x86_64 | openSUSE-Tumbleweed-Debug
   | wlr-sunclock-debuginfo             | package    | 0.1.1-1.6    | i586   | openSUSE-Tumbleweed-Debug
   | wlr-sunclock-debugsource           | package    | 0.1.1-1.6    | x86_64 | openSUSE-Tumbleweed-Debug
   | wlr-sunclock-debugsource           | package    | 0.1.1-1.6    | i586   | openSUSE-Tumbleweed-Debug
   | wlroots                            | srcpackage | 0.13.0-1.1   | noarch | Hlavní repozitář (zdroje)
   | wlroots-debugsource                | package    | 0.13.0-1.1   | x86_64 | openSUSE-Tumbleweed-Debug
   | wlroots-debugsource                | package    | 0.13.0-1.1   | i586   | openSUSE-Tumbleweed-Debug
   | wlroots-devel                      | package    | 0.13.0-1.1   | x86_64 | openSUSE:Tumbleweed
   | wlroots-devel                      | package    | 0.13.0-1.1   | x86_64 | openSUSE:Factory
   | wlroots-devel                      | package    | 0.13.0-1.1   | x86_64 | openSUSE-20180513-0
   | wlroots-devel                      | package    | 0.13.0-1.1   | x86_64 | openSUSE-Tumbleweed-Oss
   | wlroots-devel                      | package    | 0.13.0-1.1   | i586   | openSUSE:Tumbleweed
   | wlroots-devel                      | package    | 0.13.0-1.1   | i586   | openSUSE:Factory
   | wlroots-devel                      | package    | 0.13.0-1.1   | i586   | openSUSE-20180513-0
   | wlroots-devel                      | package    | 0.13.0-1.1   | i586   | openSUSE-Tumbleweed-Oss
i+ | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | x86_64 | openSUSE:Tumbleweed
i+ | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | x86_64 | openSUSE:Factory
i+ | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | x86_64 | openSUSE-20180513-0
i+ | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | x86_64 | openSUSE-Tumbleweed-Oss
v  | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | i586   | openSUSE:Tumbleweed
v  | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | i586   | openSUSE:Factory
v  | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | i586   | openSUSE-20180513-0
v  | xdg-desktop-portal-wlr             | package    | 0.3.0-1.1    | i586   | openSUSE-Tumbleweed-Oss
   | xdg-desktop-portal-wlr             | srcpackage | 0.3.0-1.1    | noarch | Hlavní repozitář (zdroje)
   | xdg-desktop-portal-wlr-debuginfo   | package    | 0.3.0-1.1    | x86_64 | openSUSE-Tumbleweed-Debug
   | xdg-desktop-portal-wlr-debuginfo   | package    | 0.3.0-1.1    | i586   | openSUSE-Tumbleweed-Debug
   | xdg-desktop-portal-wlr-debugsource | package    | 0.3.0-1.1    | x86_64 | openSUSE-Tumbleweed-Debug
   | xdg-desktop-portal-wlr-debugsource | package    | 0.3.0-1.1    | i586   | openSUSE-Tumbleweed-Debug
tmp@stitny$

Yes, I have probably too many repositories enabled...

kennylevinsen commented 3 years ago

@kennylevinsen could you please help us to understand logs that were attached above ?

The logs look good until the gtkgreet is started.

What appears to happen is:

  1. gtkgreet is started in layer shell mode with -l
  2. gtk-layer-shell initializes, but finds neither wlr_layer_shell(!) nor xdg_shell(!!!) protocol from the compositor
  3. gtk-layer-shell bails out and tries to let Gtk do it's normal thing
  4. Gtk probably fails too (haven't dug into the output here)
  5. gtkgreet tries to use layer-shell as told and fails
  6. gtkgreet crashes and sway exits as told by the ; swaymsg exit part of the command.

The interesting tidbit is part 2, and my immediate thought would be a broken gtk-layer-shell. Things to try:

denisok commented 3 years ago

@kennylevinsen thanks for you analyze!

@mcepl could you please try it from command line inside sway ?

mcepl commented 3 years ago

@kennylevinsen could you please help us to understand logs that were attached above ? The interesting tidbit is part 2, and my immediate thought would be a broken gtk-layer-shell. Things to try:

* Run `gtkgreet -l` from a normal sway session logged in as your user to see if it shows up (just click "cancel" to exit).

Login screen shows lovely absolutely perfectly (even correctly recognizes dual monitor setup with clock on one display). I don’t have [Cancel] button, but [Ctrl]+[Win]+Q works well.

* Trying without `-l` from greetd, or without gtk-layer-shell support compiled in, in which case gtkgreet becomes an entirely standard Gtk3 application with no special layer-shell sugar.

Will try.

* Otherwise, try a random other Gtk application to see if gtkgreet is the only defective thing.

meaning to start in the current sway session? Of course, they work perfectly (this is Firefox, for example).

kennylevinsen commented 3 years ago

login screen shows lovely absolutely perfectly (even correctly recognizes dual monitor setup with clock on one display).

Hmm, that sounds like gtkgreet -l works right. Could still be a race in gtk-layer-shell or something.

A not too uncommon bug is to assume that globals will be available after cranking the display connection N times, rather than just waiting for them to arrive. Could be something like that.

meaning to start in the current sway session? Of course, they work perfectly (this is Firefox, for example).

I meant in the greeter session, instead of gtkgreet. Same with trying gtkgreet without -l.

As the problem seems associated with the greeter sway session, figuring out what works there and what doesn't would help pinpoint the issue.

mcepl commented 3 years ago

meaning to start in the current sway session? Of course, they work perfectly (this is Firefox, for example).

I meant in the greeter session, instead of gtkgreet. Same with trying gtkgreet without -l.

You mean to have /etc/greetd/sway-config:

exec "/usr/bin/nautilus; swaymsg exit"

bindsym Mod4+shift+e exec swaynag \
    -t warning \
    -m 'What do you want to do?' \
    -b 'Poweroff' 'systemctl poweroff' \
    -b 'Reboot' 'systemctl reboot'

#include /etc/sway/config.d/*
denisok commented 3 years ago

@mcepl : exec "gtkgreet; swaymsg exit"

mcepl commented 3 years ago

greetd-openSUSEway-33.zip

Using greetd-0.7.0-3.1.x86_64 and sway-1.6-1.2.x86_64 from TW.

denisok commented 3 years ago

@mcepl I see exec "gtkgreet -l; swaymsg exit" what about exec "gtkgreet; swaymsg exit" ?

mcepl commented 3 years ago

Just black screen, I'll give you logs as well.

mcepl commented 3 years ago

greetd-log.zip

denisok commented 3 years ago
00:00:01.021 [DEBUG] [sway/config.c:667] Running deferred commands
00:00:01.021 [INFO] [sway/commands.c:257] Handling command 'exec "gtkgreet; swaymsg exit"'
00:00:01.021 [DEBUG] [sway/commands/exec_always.c:50] Executing gtkgreet; swaymsg exit
00:00:01.023 [DEBUG] [sway/commands/exec_always.c:91] Child process created with pid 2520
00:00:01.023 [DEBUG] [sway/tree/root.c:299] Recording workspace for process 2520
00:00:01.023 [INFO] [sway/server.c:256] Running compositor on wayland display 'wayland-1'
00:00:01.024 [DEBUG] [wlr] [render/swapchain.c:105] Allocating new swapchain buffer
00:00:01.025 [DEBUG] [wlr] [render/gbm_allocator.c:123] Allocated 1920x1080 GBM buffer (format 0x34325241, modifier 0x100000000000004)
00:00:01.025 [DEBUG] [wlr] [render/gles2/renderer.c:131] Created GL FBO for buffer 1920x1080
00:00:01.026 [DEBUG] [wlr] [render/swapchain.c:105] Allocating new swapchain buffer
00:00:01.027 [DEBUG] [wlr] [render/gbm_allocator.c:123] Allocated 1680x1050 GBM buffer (format 0x34325241, modifier 0x100000000000004)
00:00:01.027 [DEBUG] [wlr] [render/gles2/renderer.c:131] Created GL FBO for buffer 1680x1050
00:00:01.057 [DEBUG] [wlr] [types/wlr_surface.c:723] New wlr_surface 0x561de32abae0 (res 0x561de3237680)
00:00:01.057 [DEBUG] [wlr] [types/wlr_surface.c:723] New wlr_surface 0x561de328a260 (res 0x561de324e530)
Failed to register: GDBus.Error:org.freedesktop.DBus.Error.NoReply00:00:00.000 [ERROR] [common/ipc-client.c:67] Unable to connect to /run/user/448/sway-ipc.448.2333.sock
ction to Wayland compositor.
00:00:00.000 [ERROR] [common/ipc-client.c:67] Unable to connect to /run/user/448/sway-ipc.448.2501.sock

even less errors, but those 2 still there.

mcepl commented 3 years ago

even less errors, but those 2 still there.

If the problems are with gtkgreet (and DBus, apparently), shouldn't I switch to wlgreet?

mcepl commented 3 years ago

Hmm, trying wlgreet didn’t help at all:

mcepl commented 2 years ago

I think this ticket should be closed. No, openSUSEway experience with greetd is far from perfect, but I think this becomes obsolete. I will eventually open new ticket for new issues (e.g., currently it seems to me I don’t have working any Gnome programs, unfortunately including NetworkManager and keyring).

FilippoBonazziSUSE commented 8 months ago

Just letting you know that I talked to kennylevinsen and he added support for the "standard" PAM configuration file /usr/lib/pam.d in greetd. Once this is released into a new greetd version, we can improve our packaging, provide the greetd PAM configuration as /usr/lib/pam.d/greetd instead of /etc/pam.d or /usr/etc/pam.d and get rid of these rpmlint errors:

[   51s] greetd.x86_64: W: non-conffile-in-etc /etc/pam.d/greetd
[   51s] A non-executable file in your package is being installed in /etc, but is not a
[   51s] configuration file. All non-executable files in /etc should be configuration
[   51s] files. Mark the file as %config in the spec file.
[   51s]
[   51s] greetd.x86_64: E: filelist-forbidden-move-to-usr /etc/pam.d/greetd
[   51s] This directory has been moved to /usr.

See also: https://todo.sr.ht/~kennylevinsen/greetd/19