Gentoo U盘无法自动挂载,打开报告Not Authorized,xfce只有logout,suspend/shutdown灰化等问题解决方法

hal已经被udev取代,对于desktop environment,需要consolekit, policykit, udisks, upower来确保登录用户有相应的权限。所以解决方法如下:

From: http://forums.gentoo.org/viewtopic-t-858965-highlight-tips+tricks.html

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

/etc/make.conf

代码:

USE="consolekit dbus pam policykit udev" 



/etc/portage/package.use

代码:

gnome-base/gvfs gdu 



Removing cruft and installing required packages and emerging world with --newuse: 

代码:

# 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: 

代码:

# emerge -av polkit-gnome 



Alternatively: 

代码:

# emerge -av lxpolkit 



For KDE: 

代码:

# emerge -av polkit-kde-agent 



If you don't want any agent installed, you should read following documentation after installing polkit: 

代码:

$ man 8 pklocalauthority 



Required kernel options for sys-fs/udisks

代码:

CONFIG_USB_SUSPEND=y 
CONFIG_IDE=n 



Required kernel options for sys-auth/consolekit

代码:

CONFIG_AUDITSYSCALL=y 



Stopping cruft and starting daemons: 

代码:

# /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): 

代码:

$ 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: 

代码:

$ 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 
gdm 
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: 

代码:

$ 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: 

代码:

# emerge -av1 dbus-glib 



- Mangled /etc configuration for consolekit, pambase or shadow: 

代码:

# emerge -av1 --noconfmem consolekit pambase shadow 
# etc-update 



I might write proper Gentoo documentation for this later on, but I can't promise anything.

原文地址:https://www.cnblogs.com/super119/p/2824063.html