evince 在终端的错误消息中显示错误

evince 在终端的错误消息中显示错误

我已经安装了 ubuntu 12.04。我的系统中有两个用户帐户。evince 在我的一个用户帐户(user5)中显示问题。

(evince:26724): EggSMClient-WARNING **: Failed to connect to the session manager: None of the authentication protocols specified are supported

(evince:26724): Gtk-WARNING **: Attempting to read the recently used resources file at `/opt/home/user5/.local/share/recently-used.xbel', but the parser failed: Failed to open file '/opt/home/user5/.local/share/recently-used.xbel': Permission denied.

(evince:26724): Gtk-WARNING **: Attempting to store changes into `/opt/home/user5/.local/share/recently-used.xbel', but failed: Failed to create file '/opt/home/user5/.local/share/recently-used.xbel.6OQ9NX': Permission denied

(evince:26724): Gtk-WARNING **: Attempting to set the permissions of `/opt/home/user5/.local/share/recently-used.xbel', but failed: Permission denied

上述错误不断重复。我已经授予了最近使用的.xbel 文件的权限,但问题仍然存在。

请帮忙解决这个问题吗?

答案1

它可能是应用装甲

检查/var/log/kern.log类似以下条目:

May 11 10:17:35 dev kernel: [2336998.770824] type=1400 audit(1431364655.819:726): apparmor="DENIED" operation="chmod" parent=19487 profile="/usr/bin/evince" name="/data/home/fritz/.local/share/recently-used.xbel" pid=23290 comm="evince" requested_mask="w" denied_mask="w" fsuid=1001 ouid=1001

检查您的home目录在哪里。如果它是一个符号链接,/data/home -> /home那么您需要修改 AppArmor 以在其中包含真正的主目录。

sudo vim /etc/apparmor.d/tunables/home

并进行HOMEDIRS相应修改

@{HOMEDIRS}=/home/ /data/home/

然后重新启动 apparmor

sudo /etc/init.d/apparmor restart

答案2

消息“Gtk-WARNING”来访问:

/home/user/.local/share/recently-used.xbel # user is echo $USER

或者

/root/user/.local/share/recently-used.xbel # if exist

解决方法如下:

首先验证权限

ls -l /home/user/.local/share/recently-used.xbel
-rw------- 1 user user 3321 nov 21 08:58 /home/user/.local/share/recently-used.xbel

sudo lsattr /home/user/.local/share/recently-used.xbel
--------------e--- /home/user/.local/share/recently-used.xbel

如果结果不是上面描述的。例如:

-rw------- 1 root root 3321 nov 21 08:58 /home/user/.local/share/recently-used.xbel
-----i--------e--- /home/user/.local/share/recently-used.xbel

像这样修复它:

sudo chattr -i /home/user/.local/share/recently-used.xbel
sudo chown user:user /home/user/.local/share/recently-used.xbel

注意:出于安全原因,最好将其删除

来源:PostGtk 警告

相关内容