Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 571524 - >=sys-auth/consolekit-1 no longer creates /var/run/console/<USER> files
Summary: >=sys-auth/consolekit-1 no longer creates /var/run/console/<USER> files
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Jason Zaman
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-11 00:51 UTC by Javier
Modified: 2016-01-13 21:14 UTC (History)
4 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 Javier 2016-01-11 00:51:32 UTC
This is basically a regression of #257761 in >=sys-auth/consolekit-1. Breaks many services for example Bluez5 (if plugdev group is not used).

consolekit-0.4.6 contained a patch that comes from debian packaging (files/pam-foreground-compat.ck) which automatically creates a file named /var/run/console/$USER when $USER logs in locally. 

This is used by many software but most significantly the system D-Bus daemon in order to block access to some services if $USER is not logged in locally (via the "at_console" requirement). Lack of /var/run/console/$USER file manifests in many issues with D-Bus services that use the "at_console" pragma, such as Bluez. 

However, sys-auth/consolekit-1 has removed the pam-foreground-compat.ck , effectively disabling the workaround, and thus bug #257761 is now back. 

In addition, I guess patch ${PN}-cleanup_console_tags.patch should be ported over to consolekit-1, since it was part of the same fix.

Reproducible: Always

Steps to Reproduce:
This is just an example of functionality (Bluetooth)that is broken because of the missing /var/run/console/$USER file:

Prerequisites: user $USER is _not_ in the "plugdev" group, you have a bluetooth adaptor, bluez is running (any version).

1. Login locally as $USER
2. Try "qdbus --system org.bluez"
Actual Results:  
Error: org.freedesktop.DBus.Error.AccessDenied

Nothing can manage Bluetooth (as the logged in user). 

Expected Results:  
/
/org
/org/bluez
/org/bluez/hci0
...



Portage 2.2.26 (python 2.7.10-final-0, default/linux/amd64/13.0/desktop, gcc-4.9.3, glibc-2.21-r1, 4.1.12-gentoo x86_64)
=================================================================
System uname: Linux-4.1.12-gentoo-x86_64-Intel-R-_Core-TM-_i5-5675C_CPU_@_3.10GHz-with-gentoo-2.2
KiB Mem:    16224592 total,  13239688 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Sat, 09 Jan 2016 22:30:01 +0000
sh bash 4.3_p42-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
distcc 3.2rc1 x86_64-pc-linux-gnu [disabled]
app-shells/bash:          4.3_p42-r1::gentoo
dev-java/java-config:     2.2.0::gentoo
dev-lang/perl:            5.20.2::gentoo
dev-lang/python:          2.7.10-r1::gentoo, 3.4.3-r1::gentoo
dev-util/cmake:           3.3.1-r1::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.2::gentoo
sys-apps/openrc:          0.18.4::gentoo
sys-apps/sandbox:         2.6-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.13.4::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.3::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 3.18::gentoo (virtual/os-headers)
sys-libs/glibc:           2.21-r1::gentoo
Repositories:

gentoo
    location: /var/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000

javier-overlay
    location: /etc/portage/overlay
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-ggdb -O2 -pipe -march=westmere"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /etc/stunnel/stunnel.conf /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-ggdb -O2 -pipe -march=westmere"
DISTDIR="/var/portage/distfiles"
EMERGE_DEFAULT_OPTS=""
FCFLAGS="-ggdb -O2 -pipe -march=westmere"
FEATURES="assume-digests binpkg-logs buildpkg compressdebug config-protect-if-modified distlocks ebuild-locks fixlafiles installsources merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo/ http://mirrors.linuxant.fr/distfiles.gentoo.org/ http://gentoo.modulix.net/gentoo/"
INSTALL_MASK="/usr/lib/systemd /etc/systemd /lib/systemd"
LANG="es_ES.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j4"
PKGDIR="/var/portage/packages"
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"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi afp alsa amd64 avahi berkdb bluetooth bzip2 cairo cdda cdr cli consolekit cracklib crypt cups cxx dbus device-mapper dhcpcd djvu dri dts dvb dvd dvdr dvi emboss encode exif fam ffmpeg firefox flac fortran gdbm gif glamor gnome-keyring gpm gstreamer gtk iconv icu ipv6 irda java jpeg kpathsea latex lcms ldap libnotify libsecret lirc mad mate mmx mmxext mng modemmanager modules mp3 mp4 mpeg mtp multilib ncurses networkmanager nls nptl nsplugin ogg opengl openmp pam pango pcre pdf perl png policykit ppds pulseaudio python qt3support qt4 readline samba sdl seccomp session sndfile spell sse sse2 sse3 sse4 ssl ssse3 startup-notification svg tcl tcpd theora threads tiff tk truetype udev udisks unicode upower usb v4l vaapi vorbis vpx wifi wxwidgets x264 xattr xcb xcomposite xinerama xml xrandr xv xvid xvmc zeroconf zlib" ABI_X86="64" ALSA_CARDS="hda-intel emu10k1 sb16 sbawe" 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 auth_digest" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev keyboard mouse synaptics wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="es_ES es en" LIRC_DEVICES="devinput" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm" RUBY_TARGETS="ruby21" USERLAND="GNU" VIDEO_CARDS="radeon intel fbdev" 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"
USE_PYTHON="2.7"
Unset:  CC, CPPFLAGS, CTARGET, CXX, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
Comment 1 Jason Zaman gentoo-dev 2016-01-13 14:48:04 UTC
Samuli pointed me at the fact that this had been removed from ck-1.0 due to incompatibilities with BSD, but as far as we could tell at_console is dead[1] so did not add it in the ebuild at the time. The cleanup_console_tags patch does not look like it is needed since the hook already removes the tag files when the session is over.

I re-added pam-foreground-compat.ck in consolekit-1.0.1 which was just released. 

commit b6e8f7e5e1761aae662174822ee3f7e448d57235
Author: Jason Zaman <perfinion@gentoo.org>
Date:   Wed Jan 13 22:41:11 2016

    sys-auth/consolekit: Add at_console compat hook only on linux
    
    Package-Manager: portage-2.2.26


[1]: https://lists.fedoraproject.org/pipermail/devel/2014-May/199004.html
Comment 2 Javier 2016-01-13 21:14:13 UTC
Thanks. I suspect the 'cleanup_console_tags' was put in there to handle the daemon/system crash scenario leaving old files in place (technically a security issue as they may refer to users that no longer have login privileges, etc.). However, I think this cleanup is best done in the init script. Also, /var/run is cleared on boot these days either way.