编译xfce4.12后shutdown和restart按钮变灰

最大的社区版本,Ubuntu的发源地
回复
yangdawei.hit
帖子: 245
注册时间: 2015-01-02 15:32
系统: Debian

编译xfce4.12后shutdown和restart按钮变灰

#1

帖子 yangdawei.hit » 2016-02-25 8:11

OS: Debian jessie
这是我第二次编译xfce4.12,和上次一样,编译后出现的问题是:shutdown和restart按钮变灰,不能使用。休眠按钮也不可用。

查了网上一些线索:
http://wiki.xfce.org/faq#session_manager
http://ubuntuforums.org/showthread.php?t=2287208

基本上都是说问题出在xfsm-shutdown-helper的使用权限上,而根源在于xfce4-session-4.12.0,在源码README中有这样的说明:
Since 4.1.5, the session manager supports only sudo(8)-based shutdown, other
method can be added by packagers if desired, just replace XfsmShutdownHelper
with your code. To be able to shutdown the computer, you must be listed
in the systems sudoers file, in particular, you must be allowed to execute
$HELPER_PATH_PREFIX/xfce4/session/xfsm-shutdown-helper as user root (where
$HELPER_PATH_PREFIX is the directory passed to configure with the
--with-helper-path-prefix option or /usr/local/lib by default).

For example, you built xfce4-session with the default options, your hostname
is myhost and your user account is named myuser, then you'd have to add
the following line to your sudoers file (remember to use visudo to edit
that file):

myuser myhost=/usr/local/lib/xfce4/session/xfsm-shutdown-helper

Starting with xfce4-session 4.3.99.2 xfce4-session will first try to use
HAL (if built with D-Bus support) and fallback to the sudo method described
above. So if you have HAL installed on your system, and your account is
allowed to shutdown/reboot the computer using HAL, you don't need to setup
sudo at all.
按照网上帖子和README的方式在sudoers中加上了如下语名,但没有解决。

代码: 全选

yangdawei debian=/usr/local/lib/xfce4/session/xfsm-shutdown-helper
yangdawei debian=/sbin/shutdown -h now,/sbin/reboot
后来尝试用root登录桌面,发现了问题是同样存在的。现在关机和重启都在终端中用命令可实现。

解决这个问题还有另一种方式——Using hal and dbus,见http://wiki.xfce.org/faq#session_manager。但我还是不知道如何操作,疑问如下:

1. 如何确认 hal and dbus daemons are started on boot,
2. In the steps below the groupname “power” is used. 我应该使用哪个组名
3. Your /etc/dbus-1/system.d/hal.conf should contain a section similar to this: 我没有这个文件

代码: 全选

<policy group="power">
  <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
  ...
</policy>
前面还有一句:There are two way to fix this: sudo and hal/dbus. Default starting from version 4.4 is hal.
这是否意味着4.12就应按hal方式解决问题呢?

以上,请各位帮助诊断,谢谢。
回复