mako: Failed to connect to user bus: Permission denied
Hello. I’m running Sway 1.4 on Kubuntu 20.04. I put exec mako in Sway’s config, but it doesn’t work. When I manually start Mako, it gives an error Failed to connect to user bus: Permission denied
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 16 (1 by maintainers)
Commits related to this issue
- Attempt to fix mako issue with apparmour profile See https://github.com/emersion/mako/issues/257 — committed to wjdp/dotfiles by wjdp a year ago
I’m having the same problem on Ubuntu 20.04. And this seems an issue related to AppArmor. I just disable the rule for mako and it’s working.
Just a tip for some, if you get
sudo: aa-disable: command not found, installapparmor-utilswithsudo apt install apparmor-utilsFor those using Ubuntu 22.04 (I also ran into this issue 😛)- the issue is that the packaged
mako-notifierversion (1.6-2 at time of writing) still contains the apparmor profile, even though it was removed (https://github.com/emersion/mako/issues/378#issuecomment-1136003563).Two options:
add local config to
/etc/apparmor.d/local/fr.emerson.MakoThis file is sourced by the packaged profile, and you’ll need to add a combination of https://github.com/emersion/mako/issues/257#issuecomment-1049087860 and https://github.com/emersion/mako/issues/378#issuecomment-1077932960 to workaround the
Failed to acquire service name: Permission denieddbus error and to allow your symlinked config path.Reload the profile:
Disable the fr.emerson.Mako apparmor profile
Unload the mako profile:
symlink fr.emerson.Mako to the disable folder for persistence:
(I’m not that familiar with apparmor- you may be able to just delete the profile so it’s never loaded instead of symlinking it to the disable folder, but it looks like one needs to at least unload with
apparmor_parser -Rregardless of stopping/restarting the apparmor service.)Hope this helps anyone running into the same issue!
Ubuntu 20.10 workaround
Uncomment line 22 in /etc/apparmor.d/fr.emersion.Mako :
include if exists <local/fr.emersion.Mako>Create file /etc/apparmor.d/local/fr.emersion.Mako
…and add the following lines :
sudo systemctl restart apparmorThis line failed for me, on Ubuntu 20.04:
Produced this error when trying to reload/apply the profile:
Instead, I left the
/etc/apparmor.d/fr.emersion.Makofile alone (the#doesn’t comment out theinclude, it’s part of the#includedirective) and just created/etc/apparmor.d/local/fr.emersion.Makowith the following contents:This takes
makofrom failing with this error:To instead working as expected. Yay!
I am also facing this same issue on Ubuntu 22.04.
Replacing
/etc/apparmor.d/fr.emersion.Makowith the one referenced in this repo didn’t make it work for me. Copy-pasting the lines from https://github.com/emersion/mako/issues/257#issuecomment-752066251 into the existing file/etc/apparmor.d/fr.emersion.Makohowever, worked for me.I’m running Linux Mint 20.1 - based of off Ubuntu 20.04, and installed the original file with the
apparmor-profiles-extrapackage. (I couldn’t get the instructions https://github.com/emersion/mako/issues/257#issuecomment-744311184 to work, most likely because I don’t know how to make apparmor accept the local file - I guess I don’t know the correct format to input the given lines into).Quick update of the workaround, because the notifications were not closed automatically by the sender :
Same issue on debian bullseye, the workaround works. I’d like to report this to the package maintainer, but I’m confused on what the fix should be on the distribution package. Can anyone clarify this?
thanks