Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 352526 - x11-apps/xdm ships invalid pam.d file, should use system-local-login to use pam_ck_connector (among others)
Summary: x11-apps/xdm ships invalid pam.d file, should use system-local-login to use p...
Status: VERIFIED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: Gentoo X packagers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-23 18:54 UTC by Thomas
Modified: 2011-01-24 18:10 UTC (History)
2 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 Thomas 2011-01-23 18:54:37 UTC
After updating to xfce 4.8, the logout / shutdown plugin does not work any longer.  The "Shutdown" popup pops up after only quite a while; there is the error message below in .xsession-errors, explaining the delay.  Sometimes, there is a popup with a similar error message, too ("no answer from session management").  When i click the "Shutdown" button then, i am asked for a password (this is new) and then am refused to shut down the PC.

** (xfce4-session:4799): WARNING **: 'CanStop' method failed : Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.

ConsoleKit is started.  (It wasn't in the first place, so this was obviously not necessary for 4.7).

xfce is started by xdm 1.1.8  and this .xsession:

----8<----

#! /bin/sh
xhost localhost > /dev/null
export LANG=de_DE.utf8
WINDOWMANAGER=/usr/bin/xfce4-session
LAUNCHER=/usr/bin/ck-launch-session
exec $LAUNCHER $WINDOWMANAGER

----8<----

To keep PolicyKit out, this is the configuration of the machine:

app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11-r3
dev-lang/python:     2.6.6-r1, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.14-r1
sys-apps/sandbox:    2.4
sys-devel/autoconf:  2.13, 2.65-r1
sys-devel/automake:  1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.21
sys-devel/gcc:       4.3.4, 4.4.5
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.10
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1 (sys-kernel/linux-headers)
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA dlj-1.1"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -fno-strict-aliasing -march=barcelona -mabm -mcx16 -mpopcnt -msahf -msse4a -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/init.d /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /usr/share/X11/xkb"
CXXFLAGS="-O2 -fno-strict-aliasing -march=barcelona -mabm -mcx16 -mpopcnt -msahf -msse4a -pipe"
FEATURES="assume-digests binpkg-logs distlocks fixlafiles fixpackages news parallel-fetch protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
LANG="de_DE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LINGUAS="de de_DE en en_US en_GB"
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="3dnow 3dnowext X a52 aac acpi alsa amd64 berkdb branding bzip2 cairo cdda cddb cdr cli consolekit cracklib crypt cups curl cxx dbus dri dts dvd dvdr emacs emboss encode exif expat fam ffmpeg firefox flac fluidsynth fontconfig fortran gdbm gdu gif gimp gmp gnome gnome-keyring gnutls gstreamer gtk hal iconv icu ithreads java jpeg jpeg2k lame lcms libnotify libproxy log4j logrotate lzma mad midi mikmod mmx mng modules mp3 mp4 mpeg mudflap multilib mysql ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl png ppds pppd python qt4 raw readline sdl session smp sndfile spell sqlite3 sse sse2 ssl startup-notification svg sysfs system-sqlite tcpd threads tiff truetype udev unicode usb vim-syntax vorbis x264 xcb xcomposite xml xorg xpm xulrunner xv xvid zlib" ALSA_CARDS="hda-intel" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog"
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 ubx"
INPUT_DEVICES="evdev keyboard mouse"
KERNEL="linux"
LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text"
LINGUAS="de de_DE en en_US en_GB"
PHP_TARGETS="php5-3"
RUBY_TARGETS="ruby18"
USERLAND="GNU"
VIDEO_CARDS="radeon"
XFCE_PLUGINS="logout menu trash"
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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY

Especially these USE-flags are set:
USE="${USE} hal -policykit -acl"

xfce-base/thunar -udev
xfce-base/xfce4-session -udev
xfce-base/xfce4-settings sound
xfce-base/xfwm4 xcomposite

I don't even know exactly who is asked for "CanStop".  This is the process tree of my session, according to ps xf:

 4761 ?        Ss     0:00 /usr/bin/ck-launch-session /usr/bin/xfce4-session
 4799 ?        Sl     0:00  \_ /usr/bin/xfce4-session
 4810 ?        S      0:05      \_ xfwm4 --display :0.0 --sm-client-id 2c6a2b8cc-7a9c-4bd2-907a-10a20202adbb
 4815 ?        S      0:00      \_ Thunar --sm-client-id 2efdaffcb-e3cb-4970-a3f8-1a7cde014dbf --daemon
 4817 ?        Sl     0:01      \_ xfce4-panel --sm-client-id 2cf42e791-2e2e-43fb-950c-e24965791658
 4823 ?        S      0:00      |   \_ /usr/libexec/xfce4/panel-plugins/xfce4-places-plugin  3 16777248 places Orte Auf Ordner, Dokumente und entfernbare Medien zugreifen 
 4830 ?        S      0:00      |   \_ /usr/lib64/xfce4/panel/wrapper /usr/lib64/xfce4/panel/plugins/libsystray.so 7 16777249 systray Benachrichtigungsfläche Fläche, in der Symbole für Benachrichtigungen erscheinen 
 4831 ?        Sl     0:00      |   \_ /usr/libexec/xfce4/panel-plugins/xfce4-mixer-plugin  9 16777250 xfce4-mixer-plugin Lautstärkeregelung Lautstärkeregelung für Ihre Soundkarte 
 4832 ?        S      0:00      |   \_ /usr/libexec/xfce4/panel-plugins/xfce4-mount-plugin  10 16777251 xfce4-mount-plugin Geräte einhängen Zeigt alle einhängbaren Geräte an und hängt sie bei Mausklick ein/aus. 
 4834 ?        S      0:06      |   \_ /usr/libexec/xfce4/panel-plugins/xfce4-cpugraph-plugin  11 16777252 cpugraph CPU-Graph Grafische Darstellung der CPU-Last 
 4819 ?        S      0:01      \_ xfdesktop --display :0.0 --sm-client-id 2472692c1-9a15-4db1-9caf-1af1102e58d9
 5064 ?        Ss     0:00 /usr/bin/gpg-agent --sh --no-use-standard-socket --daemon --default-cache-ttl 300 --max-cache-ttl 999999
 4851 ?        S      0:00 /usr/libexec/gconfd-2
 4837 ?        S      0:00 /usr/libexec/gam_server
 4827 ?        S      0:00 xfce4-settings-helper --display :0.0 --sm-client-id 29a9b16d7-a2ff-43a2-8f88-947be3569a72
 4813 ?        S      0:00 xfsettingsd
 4806 ?        S      0:00 /usr/lib64/xfce4/xfconf/xfconfd
 4804 ?        Ss     0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
 4803 ?        S      0:00 dbus-launch --autolaunch 39353c3346c3940c3372b10047633d14 --binary-syntax --close-stderr
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2011-01-23 19:04:42 UTC
For xdm you need to edit /etc/pam.d/system-login and remove 'nox11' from pam_ck_connector.so line. This is bug 342345.

So propably a duplicate of that bug, but need output of 'ck-list-sessions' to verify.
Comment 2 Thomas 2011-01-23 19:07:02 UTC
(In reply to comment #1)
> For xdm you need to edit /etc/pam.d/system-login and remove 'nox11' from
> pam_ck_connector.so line. This is bug 342345.

I will try that.

> So propably a duplicate of that bug, but need output of 'ck-list-sessions' to
> verify.

Session1:
        unix-user = '100'
        realname = 'Thomas'
        seat = 'Seat2'
        session-type = ''
        active = FALSE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2011-01-23T17:44:07.115186Z'
        login-session-id = '4294967295'

is-local = FALSE.  Very interesting.
Comment 3 Samuli Suominen (RETIRED) gentoo-dev 2011-01-23 19:09:00 UTC
Oops. I missed "WINDOWMANAGER=/usr/bin/xfce4-session" in your original post.
That is not supported. 
Launching by 'exec ck-launch-session startxfce4' is, see [1]
startxfce4 does a lot more than what plain xfce4-session does, like executing
dbus-session if missing, running correct export's for the menu etc.

[1] http://www.gentoo.org/doc/en/xfce-config.xml
Comment 4 Samuli Suominen (RETIRED) gentoo-dev 2011-01-23 19:22:07 UTC
I'm not happy to refer you into forums, an unofficial documentation, but this has been working well for people:

https://forums.gentoo.org/viewtopic-t-858965-highlight-.html
Comment 5 Thomas 2011-01-23 20:40:30 UTC
Thanks a lot for your quick help!

(In reply to comment #3)
> Oops. I missed "WINDOWMANAGER=/usr/bin/xfce4-session" in your original post.
> That is not supported. 
> Launching by 'exec ck-launch-session startxfce4' is, see [1]

I tried it, but it didn't change the problem, in fact.  The process tree looks slightly different (gvfsd was started), but my ck-session is still non-local:

Session2:
        unix-user = '100'
        realname = 'Thomas'
        seat = 'Seat3'
        session-type = ''
        active = FALSE
        x11-display = ':0'
        x11-display-device = '/dev/tty7'
        display-device = ''
        remote-host-name = ''
        is-local = FALSE
        on-since = '2011-01-23T19:24:12.747806Z'
        login-session-id = '4294967295'

I also removed the nox11 entry from pam.d/system-login.  Do i have to restart xdm to make this effective?  (I will try this next, anyway.)

> [1] http://www.gentoo.org/doc/en/xfce-config.xml

Well, my xfce configuration is different.  I especially would like to avoid policykit, which always started to make things more complicated (this is another bug report, though) and pulls in even more garb... err... packages i don't need.  This requires me to unset udev (which i don't seem to miss, although udevd is there and started).  Should i unset hal as well?

BTW: one of the recent emerge messages stated that "policykit is dead" (good news in my ears / eyes).  Does this also yield for the xfce4 universe?
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2011-01-23 21:34:43 UTC
looks like xdm's ebuild is invalid too. it should have:

pamd_mimic system-local-login xdm auth account session

just like x11-misc/slim

moving to x11@ maintainers so they can fix the xdm ebuild
Comment 7 Thomas 2011-01-24 10:06:25 UTC
(In reply to comment #6)
> looks like xdm's ebuild is invalid too. it should have:

This was the very point, thanks a lot!

> pamd_mimic system-local-login xdm auth account session

pam.d/xdm includes system-auth instead of system-{,local-}-login.  Since pam_mail and pam_motd don't make sense on an xdm login, i added the missing lines to pam.d/xdm (marked with a * below):

#%PAM-1.0
auth            required        pam_nologin.so
auth            include         system-auth
auth            optional        pam_gnome_keyring.so *
auth            optional        pam_mount.so

account         include         system-auth
password        include         system-auth
password        optional        pam_gnome_keyring.so *

session         optional        pam_loginuid.so *
session         required        pam_env.so *
session         include         system-auth
session         optional        pam_ck_connector.so *
session         optional        pam_gnome_keyring.so auto_start *
session         optional        pam_mount.so

Thanks a lot, now logout /shutdown works fine again!
Comment 8 Thomas 2011-01-24 14:16:29 UTC
(In reply to comment #7)
> (In reply to comment #6)
> > looks like xdm's ebuild is invalid too. it should have:
> 
> This was the very point, thanks a lot!

It was not, i checked it on the wrong machine.

> > pamd_mimic system-local-login xdm auth account session

I simply tried to ln -s system-local-login xdm.  This made xdm crash on login (some segfault).  Using the pam file abv WITHOUT the pam_env.so allowed for login, but the problem (timeout on CanStop) was still present.

Updating to xdm 1.1.10 enabled me to login using both, the soft-linked system-local-login as well as the xdm file abv.

Now ck-list-sessions reports an active local session, this does not help with logout, however.

So i suspect, this is not an xdm problem.
Comment 9 Thomas 2011-01-24 15:21:49 UTC
I finally found a fix.

Switching off the consolekit USE flag of xfce4-session gets rid of the delay before the logout popup.
Entering xfsm-shutdown-helper into the sudoers file (correcting the directory to
/usr/lib64/xfce4/session/xfsm-shutdown-helper in my case) re-enabled shutdown.
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2011-01-24 15:49:14 UTC
Err... back to Comment #6 and this is the fix for it:

+*xdm-1.1.10-r1 (24 Jan 2011)
+
+  24 Jan 2011; Samuli Suominen <ssuominen@gentoo.org> +xdm-1.1.10-r1.ebuild:
+  Use pam.eclass to generate system-local-login based pam.d file instead of
+  using custom pam.d file. This is required to get pam_loginuid and
+  pam_ck_connector from pambase wrt #352526.

- Fiddling with pam.d/system-login and removing nox11 is still required wrt bug 342345. 
- Using ck-launch-session to start Xfce is also required (obviously ...)
Comment 11 Thomas 2011-01-24 16:01:29 UTC
(In reply to comment #10)
> Err... back to Comment #6 and this is the fix for it:

Maybe i should not have closed this bug so quickly.  Setting up xdm the way you propose still does not get xfce4-session a response from consolekit daemon.  (Or whom ever it asks), cf. Comment #8.

Disabling the consolekit flag obviously stops xfce4-session asking, what solves my problem (i don't know why i should use ConsoleKit, anyway).  However, xfce4-session[consolekit] has a bug.