snapd and semaphores

Olivier Tilloy olivier.tilloy at canonical.com
Mon Jan 2 15:34:33 UTC 2017


Hi everyone, and happy new year!

I’m snapping an app that makes use of semaphores¹ and seeing an
apparmor denial. The glibc implementation of sem_open calls
SHM_GET_NAME(EINVAL,SEM_FAILED,SEM_SHM_PREFIX) where SEM_SHM_PREFIX is
"sem.", so it tries to create /dev/shm/sem.{name}, which fails because
snapd only allows /dev/shm/snap.@{SNAP_NAME}.**.
At a quick glance, there’s no mechanism (e.g. env var) to customize
the prefix ("sem.").
Is this an issue others have run into? Is there a recommended solution?

Thanks in advance!

 Olivier


¹ http://man7.org/linux/man-pages/man7/sem_overview.7.html




More information about the Snapcraft mailing list