Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 770436 - gui-wm/sway-1.5.1-r1::gentoo[elogind] fails to start if polkit is not installed
Summary: gui-wm/sway-1.5.1-r1::gentoo[elogind] fails to start if polkit is not installed
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Matthew Thode ( prometheanfire )
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-14 08:38 UTC by charles17
Modified: 2022-08-14 06:56 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description charles17 2021-02-14 08:38:57 UTC
Since commit 67040dce[1] it is possible to install gui-wm/sway[elogind] without sys-auth/polkit installed.

Problem is that now starting sway seems broken:

$ sway 
00:00:00.015 [ERROR] [backend/session/logind.c:219] Failed to activate session: Permission denied
00:00:00.016 [ERROR] [backend/session/direct.c:49] Failed to open /dev/dri/card0: Permission denied
00:00:00.024 [ERROR] [backend/session/direct.c:49] Failed to open /dev/dri/card1: Permission denied
00:00:00.024 [ERROR] [backend/backend.c:303] Failed to open any DRM device
00:00:00.082 [sway/server.c:49] Unable to create backend

Prepending dbus-run-session does not help:

$ dbus-run-session sway
00:00:00.017 [ERROR] [backend/session/logind.c:219] Failed to activate session: Permission denied
00:00:00.018 [ERROR] [backend/session/direct.c:49] Failed to open /dev/dri/card0: Permission denied
00:00:00.027 [ERROR] [backend/session/direct.c:49] Failed to open /dev/dri/card1: Permission denied
00:00:00.027 [ERROR] [backend/backend.c:303] Failed to open any DRM device
00:00:00.089 [sway/server.c:49] Unable to create backend

[1] https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67040dce09c04b221c6d38ed58091eef12f50fcb

What am I doing wrong? How to start gui-wm/sway[elogind] without polkit?  
The elog message in sway-1.5.1-r1.ebuild seems misguiding (or even wrong?)


Portage 3.0.13 (python 3.9.1-final-0, default/linux/amd64/17.1, gcc-9.3.0, glibc-2.32-r6, 5.4.97-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.4.97-gentoo-x86_64-Intel-R-_Core-TM-_i7-5600U_CPU_@_2.60GHz-with-glibc2.32
KiB Mem:    16287012 total,  15032444 free
KiB Swap:     976892 total,    976892 free
Timestamp of repository gentoo: Sun, 14 Feb 2021 07:15:01 +0000
Head commit of repository gentoo: 8ff72e410f7f60f3709608665c17825d063bf88a
sh bash 5.0_p18
ld GNU ld (Gentoo 2.35.1 p2) 2.35.1
app-shells/bash:          5.0_p18::gentoo
dev-lang/perl:            5.30.3::gentoo
dev-lang/python:          3.9.1-r1::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/openrc:          0.42.1-r1::gentoo
sys-apps/sandbox:         2.20::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2-r1::gentoo
sys-devel/binutils:       2.35.1-r1::gentoo
sys-devel/gcc:            9.3.0-r2::gentoo
sys-devel/gcc-config:     2.3.2-r1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.4-r1::gentoo (virtual/os-headers)
sys-libs/glibc:           2.32-r6::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.de.gentoo.org/gentoo-portage/
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

localrepo
    location: /var/db/repos/localrepo
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="https://ftp.halifax.rwth-aachen.de/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl amd64 berkdb bzip2 cli crypt dri elogind fortran gdbm iconv ipv6 libglvnd libtirpc multilib ncurses nls nptl openmp pam pcre readline seccomp split-usr ssl tcpd unicode wayland xattr zlib" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2 aes avx avx2 f16c fma3 pclmul popcnt sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS

=================================================================
                        Package Settings
=================================================================

gui-wm/sway-1.5.1-r1::gentoo was built with the following:
USE="elogind man swaybar swaylock swaymsg swaynag tray -X -fish-completion -seatd -swaybg -swayidle -systemd -wallpapers -zsh-completion" ABI_X86="(64)"
Comment 1 Andreas Sturmlechner gentoo-dev 2021-02-14 09:38:26 UTC
Someone claimed they had it running like that, maybe they should make a wiki entry then.
Comment 2 charles17 2021-02-15 08:05:35 UTC
More information, inspired by bug 708680

sway -V
00:00:00.000 [sway/main.c:326] Sway version 1.5.1
00:00:00.016 [sway/main.c:153] Linux E7450 5.4.97-gentoo #1 SMP Fri Feb 12 16:38:32 CET 2021 x86_64 Intel(R) Core(TM) i7-5600U CPU @ 2.60GHz GenuineIntel GNU/Linux
00:00:00.016 [sway/main.c:169] Contents of /etc/os-release:
00:00:00.016 [sway/main.c:153] NAME=Gentoo
00:00:00.016 [sway/main.c:153] ID=gentoo
00:00:00.016 [sway/main.c:153] PRETTY_NAME="Gentoo/Linux"
00:00:00.016 [sway/main.c:153] ANSI_COLOR="1;32"
00:00:00.016 [sway/main.c:153] HOME_URL="https://www.gentoo.org/"
00:00:00.016 [sway/main.c:153] SUPPORT_URL="https://www.gentoo.org/support/"
00:00:00.016 [sway/main.c:153] BUG_REPORT_URL="https://bugs.gentoo.org/"
00:00:00.016 [sway/main.c:169] Contents of /etc/gentoo-release:
00:00:00.016 [sway/main.c:153] Gentoo Base System release 2.7
00:00:00.016 [sway/main.c:141] LD_LIBRARY_PATH=(null)
00:00:00.016 [sway/main.c:141] LD_PRELOAD=(null)
00:00:00.016 [sway/main.c:141] PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/bin:/usr/lib/llvm/11/bin
00:00:00.016 [sway/main.c:141] SWAYSOCK=(null)
00:00:00.018 [ERROR] [backend/session/logind.c:219] Failed to activate session: Permission denied
00:00:00.018 [INFO] [backend/session/direct.c:274] Successfully loaded direct session
00:00:00.019 [ERROR] [backend/session/direct.c:49] Failed to open /dev/dri/card0: Permission denied
00:00:00.034 [ERROR] [backend/session/direct.c:49] Failed to open /dev/dri/card1: Permission denied
00:00:00.034 [INFO] [backend/backend.c:157] Found 0 GPUs
00:00:00.034 [ERROR] [backend/backend.c:303] Failed to open any DRM device
00:00:00.094 [sway/server.c:49] Unable to create backend
Comment 3 Katherine Peeters 2021-05-25 13:53:20 UTC
Hello, I believe it was I that suggested in a previous bug that sys-auth/polkit wasn't required for gui-wm/sway[elogind].

I suspect that indeed something has changed, as I'm unable to get it working without polkit for newer versions of elogind (>sys-auth/elogind-246.9.2). Previously, with versions <=sys-auth/elogind-246.9.2, it worked fine.

Maybe upstream changed something? I'll do some testing on my machine.
Comment 4 Katherine Peeters 2021-06-08 16:56:35 UTC
I'm now using sys-auth/elogind-246.10-r1 and gui-wm/sway-1.6, the latest amd64 stable versions of those packages. I do momentarily get a "Permission denied" error when sway starts, still trying to get some more information about that, however apart from that error message, everything runs fine (have been using this system for over a week and have yet to find any problems). sys-auth/polkit is still not installed. So, it appears that my initial comment was correct: sys-auth/polkit is *not* required to use gui-wm/sway with sys-auth/elogind.

It would be helpful to know which version of elogind caused this error to occur, as well as whether or not upgrading to the latest stable version of both elogind and sway fixes the problem. I've been unable to reproduce with the latest stable of elogind and sway.