Tuesday, January 14, 2014

dbus error on connection to CentOS 6 and SELinux

There are a number of postings around talking about 'Could not connect to session bus: An SELinux policy prevents this sender from sending this message to this recipient (rejected message had sender "(unset)" interface "org.freedesktop.DBus" member "Hello" error name "(unset)" destination "org.freedesktop.DBus")' with suggestions it's solved. Not for me, not using NoMachine, even with SELinux being permissive. Weird. Anyway, here's what worked:
$sudo grep dbus /var/log/audit/audit.log | audit2allow

#============= ROLES ==============

role system_r types unconfined_dbusd_t;

$ sudo grep dbus /var/log/audit/audit.log | audit2allow -M dbus
$ sudo semodule -i dbus.pp