Better error when --host=ipc but no /dev/mqueue

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
Upstream-commit: fd955ce6ca7c8659d76de5dc397b307a3a22e2c4
Component: engine
This commit is contained in:
Burke Libbey
2015-10-14 10:52:16 -04:00
parent 177d0dd24f
commit 5ff41583d8
@@ -217,6 +217,12 @@ func populateCommand(c *Container, env []string) error {
} else {
ipc.HostIpc = c.hostConfig.IpcMode.IsHost()
if ipc.HostIpc {
if _, err := os.Stat("/dev/shm"); err != nil {
return fmt.Errorf("/dev/shm is not mounted, but must be for --host=ipc")
}
if _, err := os.Stat("/dev/mqueue"); err != nil {
return fmt.Errorf("/dev/mqueue is not mounted, but must be for --host=ipc")
}
c.ShmPath = "/dev/shm"
c.MqueuePath = "/dev/mqueue"
}