Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Desktop Environments
  • Search

Tips and tricks for ConsoleKit, PolicyKit, and udev helpers

Problems with GUI applications? Questions about X, KDE, Gnome, Fluxbox, etc.? Come on in. NOTE: For multimedia, go up one forum
Post Reply
Advanced search
383 posts
  • Page 1 of 16
    • Jump to page:
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 16
  • Next
Author
Message
SamuliSuominen
Retired Dev
Retired Dev
Posts: 2133
Joined: Fri Sep 30, 2005 8:38 am
Location: Finland

Tips and tricks for ConsoleKit, PolicyKit, and udev helpers

  • Quote

Post by SamuliSuominen » Wed Jan 05, 2011 8:29 pm

Here is a small checklist to get a working ConsoleKit and PolicyKit setup for your console and X11.

/etc/make.conf:

Code: Select all

USE="consolekit dbus pam policykit udev udisks upower"
/etc/portage/package.use speciality for stable users because their gnome-base/gvfs has USE="udisks" temporarily masked:

Code: Select all

gnome-base/gvfs gdu
Removing cruft and installing required packages and emerging world with --newuse:

Code: Select all

# emerge -C hal hal-info policykit devicekit devicekit-disks devicekit-power 
# emerge -av gvfs udisks upower
# emerge -avDNut world
You need authentication agent installed to replace plain "Not authorized." dialog with useful password dialog:

For GTK+ based desktops:

Code: Select all

# emerge -av polkit-gnome
Alternatively:

Code: Select all

# emerge -av lxpolkit
For KDE:

Code: Select all

# emerge -av polkit-kde-agent
If you don't want any agent installed, you should read following documentation after installing polkit:

Code: Select all

$ man 8 polkit
Required kernel options for sys-fs/udisks:

Code: Select all

CONFIG_USB_SUSPEND=y
CONFIG_IDE=n
Required kernel options for sys-auth/consolekit:

Code: Select all

CONFIG_AUDITSYSCALL=y
Stopping cruft and starting daemons:

Code: Select all

# /etc/init.d/hald stop
# rc-update del hald
# rc-update add dbus default
# rc-update add consolekit default
# /etc/init.d/consolekit start
Method to start Xfce from startx (This is without dbus-launch because startxfce4 command itself runs a dbus session and running two is a mistake):

Code: Select all

$ echo 'exec ck-launch-session startxfce4' > .xinitrc
$ startx
Method to start openbox and others which don't run dbus-session on their own from startx:

Code: Select all

$ echo 'exec ck-launch-session dbus-launch --sh-syntax --exit-with-session openbox-session' > .xinitrc
$ startx
You can reuse above openbox or xfce syntax for other desktops. First try without dbus-launch, then with dbus-launch.

Gentoo has following display managers in Portage with native ConsoleKit support:

xdm
slim
lightdm
old gdm-2 (note that gdm-3.8+ removed CK support and only works with systemd)
kdm
lxdm

Make sure to use latest version(s) since some of them gained support only recently.

In the end, you should see active session in or outside of X11:

Code: Select all

$ ck-list-sessions
Session1:
	unix-user = '1000'
	realname = '(null)'
	seat = 'Seat1'
	session-type = ''
	active = FALSE
	x11-display = ''
	x11-display-device = ''
	display-device = '/dev/tty1'
	remote-host-name = ''
	is-local = TRUE
	on-since = '2010-12-25T09:44:12.519713Z'
	login-session-id = '1'
	idle-since-hint = '2011-01-02T16:04:09.020983Z'
Session3:
	unix-user = '1000'
	realname = '(null)'
	seat = 'Seat1'
	session-type = ''
	active = TRUE                                         <- The most important part. This is what we are aiming at.
	x11-display = ':0'
	x11-display-device = '/dev/tty7'
	display-device = '/dev/tty1'
	remote-host-name = ''
	is-local = TRUE
	on-since = '2011-01-02T16:03:40.847555Z'
	login-session-id = '1'                                <- If this is empty, you propably missed the CONFIG_AUDITSYSCALL=y option in kernel.
Known issues that would prevent this from working:

- You removed nox11 parameter from /etc/pam.d/system-login earlier, but forgot to restore it now that the native ConsoleKit support is available
in your display manager?

- When using the native ConsoleKit support (which is either enabled by USE="consolekit" or always enabled in the different display managers)
you should *not* write commands like dbus-launch or ck-launch-session yourself *anywhere* because the display manager does it for you.

- Entries in /etc/fstab *conflict* with sys-fs/udisks. For example, if you want your cdrom to be handled by udisks (and file manager supporting it, like nautilus, pcmanfm or Thunar) you should *remove entries* related to it from /etc/fstab.

- Need to recompile dev-libs/dbus-glib after deb-libs/glib upgrade. Yes, by hand:

Code: Select all

# emerge -av1 dbus-glib
- Mangled /etc configuration for consolekit, pambase or shadow:

Code: Select all

# emerge -av1 --noconfmem consolekit pambase shadow
# etc-update
I might write proper Gentoo documentation for this later on, but I can't promise anything.
Last edited by SamuliSuominen on Wed Aug 28, 2013 5:04 pm, edited 25 times in total.
Top
Kollin
Veteran
Veteran
User avatar
Posts: 1139
Joined: Sat Feb 25, 2006 12:42 am
Location: Sofia/Bulgaria

  • Quote

Post by Kollin » Wed Jan 05, 2011 9:32 pm

Tank you!
That was needed please make it sticky! :D
ssuominen wrote:
Hint: It's also good idea to mask sys-apps/hal in /etc/portage/package.mask to prevent it's installation and to detect remaining cruft when emerging world. To remove them.

Sadly k3b requires hal (not as use flag)
"Dear Enemy: may the Lord hate you and all your kind, may you be turned orange in hue, and may your head fall off at an awkward moment."
"Linux is like a wigwam - no windows, no gates, apache inside..."
Top
discomfitor
l33t
l33t
User avatar
Posts: 927
Joined: Fri Feb 21, 2003 11:51 pm
Location: None

  • Quote

Post by discomfitor » Thu Jan 06, 2011 4:29 am

For those using e17, make sure you have USE="udev ukit" when you build e_dbus/enlightenment and it will be automagically enabled.
There is no substitute for experience.
Imperfection indicates a lack of effort.
Top
Peach
Advocate
Advocate
User avatar
Posts: 3686
Joined: Sat Mar 08, 2003 9:00 pm
Location: London, UK
Contact:
Contact Peach
Website

  • Quote

Post by Peach » Thu Jan 06, 2011 6:33 pm

great guide, thanks a lot for the effort put into it.

As a side note, I didn't find the need to install polkit-gnome (or equivalent, but I'm using slim) and it seems like everything works as espected :)

brilliant
Gentoo user since 2004.
"It's all fun and games, until someone loses an eye" - mom
Top
obo68
n00b
n00b
User avatar
Posts: 14
Joined: Sun Jun 12, 2005 1:19 am
Location: Magdeburg, Germany

  • Quote

Post by obo68 » Fri Jan 07, 2011 12:05 am

... just a small remark,

for me (using an amd64 system) it works even with the stable versions:
  • sys-apps/dbus-1.4.1
  • dev-libs/dbus-glib-0.88
  • sys-auth/pambase-20101024
  • sys-apps/shadow-4.1.4.2-r6
  • sys-fs/udisks-1.0.1-r2
  • sys-power/upower-0.9.5
  • sys-auth/polkit-0.96-r1
  • gnome-base/gvfs-1.6.4-r2
  • gnome-extra/polkit-gnome-9.96-r1
kernel 2.6.36-r5
xorg-server-1.9.2

use flags form /etc/make.conf:

Code: Select all

USE="-hal -arts -kde -qt3 -qt4 -ati X nvidia xvmc a52 aac acpi aim alsa apache2 
audiofile bash-completition bzip2 cdr consolekit crypt cups dbus device-mapper 
dv dvd dvdr dri encode esd exif ffmpeg firefox flac ftp gd gdbm gif glut gnome gnutls 
gphoto2 gstreamer gtk gtkhtml guile hddtemp iconv icq imagemagick imlib innodb 
javascript joystick jbig jpeg jpeg2k latex lcms ldap libgda libwww lm_sensors 
lzo mad mime mmx mng motif mp3 mp4 mpeg mplayer mysql mysqli ncurses nls nptl 
nsplugin odbc ogg openexr opengl oscar pam pdf perl php plotutils png policykit 
posix ppds python quicktime raw readline sdl smp sndfile sockets sox spell sse sse2 
ssl startup-notification svg syslog sysvipc taglib tcpd theora threads tiff 
truetype udev unicode usb v4l2 videos vorbis wmf wxwindows x264 xcb xcomposite 
xface xine xml xmms xpm xscreensaver xv xvid yahoo zlib"

INPUT_DEVICES="evdev joystick"

VIDEO_CARDS="nvidia vesa"
jep, no keyboard and no mouse entry in INPUT_DEVICES!
So, no need to update the gnome branch to the (still unstable) 2.32 version.

In hope this is useful for anyone and encourages the installation of a hal-free env.

Oliver.
Gentoo Linux 2013.0 (3.6.11-r1)
AMD Phenom 9950 @ 2800 MHz, watercooled
4GB RAM, 146+74GB SCSI U320, 2x500GB SATA raid1
GeForce 9600 GT
Top
d2_racing
Bodhisattva
Bodhisattva
User avatar
Posts: 13047
Joined: Mon Apr 25, 2005 2:25 pm
Location: Ste-Foy,Canada
Contact:
Contact d2_racing
Website

  • Quote

Post by d2_racing » Wed Jan 12, 2011 12:32 am

The guide is sticked now.

If it will be a must to have an official Gentoo documentation about that subject.
Top
just1602
n00b
n00b
Posts: 6
Joined: Sun Dec 26, 2010 3:59 am
Location: Québec, Canada

  • Quote

Post by just1602 » Wed Jan 12, 2011 3:39 am

Thank you, it's working perfectly on my ~amd64 system with Openbox :- )

I'll try to do the same with my x86 system :P

@++

Justin :)
Top
hal2050
n00b
n00b
Posts: 47
Joined: Sat Jul 19, 2008 6:19 pm

  • Quote

Post by hal2050 » Wed Jan 12, 2011 1:18 pm

is it allowed to post problems in this thread or is it rather recommended to start a new thread referring to the sticky?
Top
slackline
Veteran
Veteran
User avatar
Posts: 1479
Joined: Fri Apr 01, 2005 7:22 pm
Location: /uk/sheffield
Contact:
Contact slackline
Website

Re: Tips, and tricks for ConsoleKit/PolicyKit/udev, without

  • Quote

Post by slackline » Wed Jan 12, 2011 2:11 pm

ssuominen wrote: Required kernel options:

Code: Select all

CONFIG_USB_SUSPEND=y    <- Required for properly shutting down and powering USB hubs, for like, external USB HDD.
CONFIG_IDE=n                    <- This breaks both udev, and udisks.
CONFIG_AUDITSYSCALL=y   <- This is really required, it might work out of fluke with gnome-base/gdm but that's pretty much it.
Just to help with these kernel options (under 2.6.37) you can find them under...

Code: Select all

-> Device Drivers
   -> USB support (USB_SUPPORT [=y])
      -> Support for Host-side USB (USB [=y])
             [*]    USB runtime power management (autosuspend) and wakeup   CONFIG_USB_SUSPEND=y    <- Required for properly shutting down and powering USB hubs, for like, external USB HDD.
-> Device Drivers 
  [ ] ATA/ATAPI/MFM/RLL support (DEPRECATED)   CONFIG_IDE=n                    <- This breaks both udev, and udisks.

-> General setup
  -> Auditing support (AUDIT [=y])
    [*] Enable system-call auditing support  CONFIG_AUDITSYSCALL=y   <- This is really required, it might work out of fluke with gnome-base/gdm but that's pretty much it.
Also CONFIG_USB_SUSPEND is dependent upon...

Code: Select all

 -> Power management and ACPI options
    [*] Run-time PM core functionality  PM_RUNTIME
..which I didn't have selected and had me scratching my head for a minute or two (until I actually read the information on dependencies from searching menuconfig with '/' and searching for USB_SUSPEND)
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Top
slackline
Veteran
Veteran
User avatar
Posts: 1479
Joined: Fri Apr 01, 2005 7:22 pm
Location: /uk/sheffield
Contact:
Contact slackline
Website

  • Quote

Post by slackline » Wed Jan 12, 2011 2:53 pm

Quick question.

What if you're not using 'startx' or one of the 'small' login clients?

I'm using gdm, so do I still need to have a custom ~/.xinitrc or make any changes to /etc/pam.d/system-login ?
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Top
SamuliSuominen
Retired Dev
Retired Dev
Posts: 2133
Joined: Fri Sep 30, 2005 8:38 am
Location: Finland

  • Quote

Post by SamuliSuominen » Wed Jan 12, 2011 2:57 pm

slack---line wrote:Quick question.

What if you're not using 'startx' or one of the 'small' login clients?

I'm using gdm, so do I still need to have a custom ~/.xinitrc or make any changes to /etc/pam.d/system-login ?
- gdm doesn't use the pam_ck_connector.so
- gdm has internal consolekit support

Therefore:

No changes to system-login or .xinitrc should be required at this time for GDM users.
Top
slackline
Veteran
Veteran
User avatar
Posts: 1479
Joined: Fri Apr 01, 2005 7:22 pm
Location: /uk/sheffield
Contact:
Contact slackline
Website

  • Quote

Post by slackline » Wed Jan 12, 2011 2:58 pm

Thanks for the quick response and writing this guide ssuominen, very, very useful and much appreciated.
"Science is what we understand well enough to explain to a computer.  Art is everything else we do." - Donald Knuth
Top
wuzzerd
Guru
Guru
Posts: 467
Joined: Wed Jan 05, 2005 4:43 am
Location: New Mexico

Re: Tips, and tricks for ConsoleKit/PolicyKit/udev, without

  • Quote

Post by wuzzerd » Wed Jan 12, 2011 3:36 pm

Nice sticky. For once I had most of it right.
slack---line wrote: ..which I didn't have selected and had me scratching my head for a minute or two...
My experience exactly, then a minute later I read your post. Heh.
Top
aramis_qc
Tux's lil' helper
Tux's lil' helper
User avatar
Posts: 106
Joined: Sun Sep 24, 2006 4:42 pm
Location: Québec - Canada

  • Quote

Post by aramis_qc » Thu Jan 13, 2011 2:06 pm

It works fine. But Xfce4 4.8 is not ready to move to stable. Too much problems to be fixed... for example hibernation does not work...

Thank's for the tip ... at least we can say goodbye to hal.
Profil et systèmes
Top
zoolook
n00b
n00b
User avatar
Posts: 16
Joined: Sat Oct 05, 2002 8:52 am

automounter for console-only setups, or without gnome- kde-

  • Quote

Post by zoolook » Fri Jan 14, 2011 12:37 pm

Hi,

I found this sticky quite useful, even if I instinctively did almost 95% the same before finding it. I'd like to add that users not wanting to deal with gnome or kde or other bloated window managers, or even need automounting just at console level, may use

Code: Select all

sys-fs/udisks-glue-1.2.0
which in its current ebuild unfortunately comes without a config file or a gentoo service script. Well, I uploaded an updated ebuild with initial script and config file at [bug=351644]Bug # 351644[/bug], you may try that out.

One more comment, in recent kernels,

Code: Select all

CONFIG_USB_SUSPEND
may no longer be available, as the devs apparently changed the power management architecture of the USB subsystem.

Cheers,
Lucian

P.S. @ssuominen: gosh, now after sending the initial reply I realize that you're maintaining udisks-glue ;-)
Last edited by zoolook on Fri Jan 14, 2011 12:58 pm, edited 1 time in total.
Top
Anon-E-moose
Watchman
Watchman
User avatar
Posts: 6566
Joined: Fri May 23, 2008 7:31 pm
Location: Dallas area

  • Quote

Post by Anon-E-moose » Fri Jan 14, 2011 12:56 pm

For those like me, who run a single user system, don't suspend/hibernate, and don't use automounting
they don't need to use "ck-launch-session" or the associated "dbus stuff" in their .xinitrc file.

This is my .xinitrc file and yes it works fine.

Code: Select all

#!/bin/sh
#
# ~/.xinitrc
#
exec > /home/don/.xsession-errors 2>&1
# Executed by startx (run your window manager from here)
#-------------
XDG_CONFIG_HOME="$HOME/.config"
XDG_MENU_PREFIX="lxde-"
XSESSION="LXDE"
export XDG_MENU_PREFIX XSESSION XDG_CONFIG_HOME
eval `cat $HOME/.fehbg` &
exec cairo-compmgr &
exec /usr/bin/lxsession -s DON -e LXDE
#-------------
#exec /usr/bin/openbox-session
#-------------
#XDG_MENU_PREFIX="xfce-"
#XSESSION="Xfce4"
#export XDG_MENU_PREFIX XSESSION
#exec /usr/bin/xfce4-session
I get logout and that's all I really need anyway.

Just an FYI
UM780 xtx, 6.18 zen kernel, gcc 15, openrc, wayland
minixforum m1-s1 max -- same software as above but used for ai learning


Zealots are gonna be zealots, just like haters are gonna be haters
Top
mack1
Guru
Guru
User avatar
Posts: 315
Joined: Sat Mar 18, 2006 1:42 pm

  • Quote

Post by mack1 » Sun Jan 16, 2011 2:25 pm

Thanks a lot for useful guide :D !!!

Cheers
Top
NeddySeagoon
Administrator
Administrator
User avatar
Posts: 56080
Joined: Sat Jul 05, 2003 9:37 am
Location: 56N 3W

  • Quote

Post by NeddySeagoon » Sun Jan 16, 2011 4:25 pm

ssuominen,

Works for me ... thanks very much
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Top
toralf
Developer
Developer
User avatar
Posts: 3944
Joined: Sun Feb 01, 2004 2:58 pm
Location: Hamburg
Contact:
Contact toralf
Website

Re: Tips, and tricks for ConsoleKit/PolicyKit/udev, without

  • Quote

Post by toralf » Sun Jan 16, 2011 4:58 pm

ssuominen wrote:

Code: Select all

# rc-update add consolekit default
WRT please, could you take a look at this https://bugs.gentoo.org/show_bug.cgi?id=351537 ?
Top
Ant P.
Watchman
Watchman
Posts: 6920
Joined: Sat Apr 18, 2009 7:18 pm
Contact:
Contact Ant P.
Website

  • Quote

Post by Ant P. » Mon Jan 17, 2011 12:33 am

Is PAM really mandatory now?
Top
drinstant
n00b
n00b
Posts: 24
Joined: Thu Apr 08, 2010 9:16 am

  • Quote

Post by drinstant » Mon Jan 17, 2011 5:13 pm

Openbox user here. Thanks for your instructions. I got everything working, but one problem with NetworkManager still persists. Not sure if it's a bug, as it's mentioned all over the place, but it could be related.

Problem is, even following your instructions, ck-list-sessions still gives a single instance, with active = FALSE, which is not supposed to be the case as you'll agree. nm-applet will refuse do do anything as non-root (enable/disable networking or connect to anything). My guess is, that the two are related (as it seems to be a permission-problem). If not, then forgive me for spamming this topic.
Top
SamuliSuominen
Retired Dev
Retired Dev
Posts: 2133
Joined: Fri Sep 30, 2005 8:38 am
Location: Finland

  • Quote

Post by SamuliSuominen » Mon Jan 17, 2011 5:40 pm

Ant_P wrote:Is PAM really mandatory now?
Yep. I don't know of other ways of hooking the login (shadow) to consolekit.

Unless you count gnome-base/gdm as an option, it's internal consolekit support should work without pam... but this might change at anytime, it's really supposed to be using the same method others are and maintainers might change it soon.
Top
SamuliSuominen
Retired Dev
Retired Dev
Posts: 2133
Joined: Fri Sep 30, 2005 8:38 am
Location: Finland

  • Quote

Post by SamuliSuominen » Mon Jan 17, 2011 5:42 pm

drinstant wrote:Problem is, even following your instructions, ck-list-sessions still gives a single instance, with active = FALSE, which is not supposed to be the case as you'll agree. nm-applet will refuse do do anything as non-root (enable/disable networking or connect to anything). My guess is, that the two are related (as it seems to be a permission-problem). If not, then forgive me for spamming this topic.
The whole point of this thread was to get 'active = TRUE' so something's definately wrong in your end.
Top
drinstant
n00b
n00b
Posts: 24
Joined: Thu Apr 08, 2010 9:16 am

  • Quote

Post by drinstant » Tue Jan 18, 2011 11:18 am

ssuominen wrote: The whole point of this thread was to get 'active = TRUE' so something's definately wrong in your end.
Finally got it working, by re-emerging consolekit mith --noconfmem. Phew, don't know why this was the thing that did it.
Top
IgorPashev
n00b
n00b
Posts: 16
Joined: Wed Jan 19, 2011 2:24 pm

  • Quote

Post by IgorPashev » Wed Jan 19, 2011 2:51 pm

xfce should startx with

Code: Select all

ck-launch-session dbus-launch xfce4-session
within /etc/xdg/xfce4/xinitrc

ck-launch-session startxfce4 does not work for me (no power managment, no mount)
and
ck-launch-session xfce4-session is not enough (I can't mount/umount media by desktop or Thunar,
but can do it in terminal emulator).
Last edited by IgorPashev on Thu Jan 20, 2011 8:52 pm, edited 4 times in total.
Top
Post Reply

383 posts
  • Page 1 of 16
    • Jump to page:
  • 1
  • 2
  • 3
  • 4
  • 5
  • …
  • 16
  • Next

Return to “Desktop Environments”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic