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

Signed-off-by: Burke Libbey <burke.libbey@shopify.com>
This commit is contained in:
Burke Libbey
2015-10-14 10:50:43 -04:00
committed by Tibor Vass
parent 44c74f2109
commit d2e25ed81c
+6
View File
@@ -218,6 +218,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"
}