2

Evince shows PDF documents and needs fonts.

Context: ~/.cache symlinked by administrator

Users directory here are split between a "clean" part and a "messy" part. The idea is to care more about the "clean" parts (backup etc) and less about the "messy" parts.

The users' ~/.cache is a symlink to the messy part.

Symptom: slow start

This causes evince to start slowly: 20 seconds wait before any window appear. After the window appears, things seem normal.

Investigation

  • strace shows that during the first 2 seconds, it tries a lot to access files in ~/.cache/fontconfig and /var/cache/fontconfig that fail with EACCESS
  • then it spends about 18 seconds enumerating data in /usr/share/fonts
  • ~/.cache/fontconfig is readable and writable by user, /var/cache/fontconfig does not exist.

Interpretation

Similar issues (e.g. Evince...(Permission denied) - Ask Ubuntu ) strongly suggest that AppArmor is involved.

How to fix?

Stéphane Gourichon
  • 2,039
  • 22
  • 35

1 Answers1

1

This is solved immediately by modifying /etc/apparmor.d/abstractions/fonts to include a line like this:

/complete/template/path/to/userdirs/*/.cache/fontconfig          r,

This applies to all users (* being at the part of the path that is the user login).

This feels correct. Is it?

Stéphane Gourichon
  • 2,039
  • 22
  • 35