pop-os / cosmic-greeter

libcosmic greeter for greetd, which can be run inside cosmic-comp
GNU General Public License v3.0
39 stars 18 forks source link

cosmic-greeter fails to log in to cosmic session when SELinux is set to `ENFORCING` #35

Open ryanabx opened 2 months ago

ryanabx commented 2 months ago

start-cosmic works fine, cosmic-session works fine, so I'm pretty confused and I've been trying to figure out why cosmic-greeter won't log in to the session properly. All I get is a brief black screen with a panic in greetd:

thread 'main' panicked at greetd/src/session/worker.rs:200:14:
unable to exec: EACCES

I tried looking at it with RUST_BACKTRACE=full but the stack trace was completely unhelpful, going through a lot of unknown areas and some libc areas

I have these dependencies installed (not including dependencies derived from build depends) (Fedora)

Drakulix commented 2 months ago

Seems more like a greetd issue than a cosmic-greeter one? Just a shot in the dark, does disabling selinux fix it?

ryanabx commented 2 months ago

I'll give it a go tonight (i.e. you'll hear from me in about 6 hours)

ryanabx commented 2 months ago

It was SELinux after all, I'll rename this issue and keep it open for tracking purposes, unless it would be preferred to close it

Drakulix commented 2 months ago

Feel free to keep this open, but I don't think there is something actionable for us, as this is likely a greetd-selinux problem.

ryanabx commented 2 months ago

Feel free to keep this open, but I don't think there is something actionable for us, as this is likely a greetd-selinux problem.

Makes sense, I'll file an upstream issue, and link it here when I do. Probably will keep this open just so people who stumble upon the issue know what's going on

rrahl0 commented 1 month ago

@ryanabx, could you please reference the upstream issue, as I can't find it.

ryanabx commented 1 month ago

@ryanabx, could you please reference the upstream issue, as I can't find it.

My bad, I actually forgot to file that issue 😅

rivenirvana commented 1 month ago

Any updates regarding this issue? Is it confirmed to be a greetd-selinux problem?

lauretano commented 1 month ago

I'm excited about cosmic but sad about it being unavailable on my "production" workstations due to the selinuxing, so did some digging. the upstream issue discussion

Based on more recent discussion, a couple triggers include the rpm-ostree and OCI build processes and their handling of labeling.

Red Hat Bug 2224162 - selinux denial prevents logging in

see also https://github.com/ublue-os/main/issues/223

and much more recent discussion here https://github.com/ostreedev/ostree-rs-ext/issues/388

Mostly related threads, mentioning silverblue, ublue oci images, and even bluebuild custom oci images based on ublue and silverblue itself. I'm using a mix of those across all of my daily linux workstations oops.

rrahl0 commented 1 month ago

are we sure it's actually greetd? I used the fedora server qcow2 image and installed cosmic (so no gnome is available) and it works out of the box.

rivenirvana commented 1 month ago

FWIW, I installed ryanabx's COPR on a F40 GNOME Workstation and I can log into COSMIC just fine as well.

rrahl0 commented 1 month ago

@rivenirvana are you using gdm or cosmic-greeter (greetd)

Drakulix commented 1 month ago

are we sure it's actually greetd? I used the fedora server qcow2 image and installed cosmic (so no gnome is available) and it works out of the box.

It seems to be a combination of using greetd with SElinux and a read-only image based desktop.

lauretano commented 3 weeks ago

Also confirming this, just installed cosmic-desktop on Asahi Linux (fedora on apple silicon), no need to disable selinux there at all. Does looks like the bug isn't outside cosmic-greeter