2
0
mirror of git://github.com/lxc/lxc synced 2025-08-31 00:19:33 +00:00

mount /dev/mqueue

Mount always /dev/mqueue with lxc_init.

Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
This commit is contained in:
Daniel Lezcano
2009-10-15 14:17:14 +02:00
parent d685aa8049
commit 0e322d2295
2 changed files with 12 additions and 2 deletions

View File

@@ -27,7 +27,7 @@
LXC_CREATE_CAPS="cap_sys_admin"
LXC_NETSTAT_CAPS="cap_sys_admin"
LXC_INIT_CAPS="cap_sys_admin"
LXC_INIT_CAPS="cap_sys_admin,cap_dac_override"
LXC_UNSHARE_CAPS="cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override"
LXC_START_CAPS="cap_fowner,cap_sys_chroot,cap_setpcap,cap_net_admin,cap_net_raw,cap_sys_admin,cap_dac_override"
LXC_EXECUTE_CAPS=$LXC_START_CAPS

View File

@@ -27,6 +27,7 @@
#include <errno.h>
#include <signal.h>
#include <libgen.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/mount.h>
@@ -49,7 +50,7 @@ static struct option options[] = {
static int mount_fs(const char *source, const char *target, const char *type)
{
/* sometimes the umount fails */
/* the umount may fail */
if (umount(target))
WARN("failed to unmount %s : %s", target, strerror(errno));
@@ -71,6 +72,15 @@ static inline int setup_fs(void)
if (mount_fs("shmfs", "/dev/shm", "tmpfs"))
return -1;
/* If we were able to mount /dev/shm, then /dev exists */
if (access("/dev/mqueue", F_OK) && mkdir("/dev/mqueue", 0666)) {
SYSERROR("failed to create '/dev/mqueue'");
return -1;
}
if (mount_fs("mqueue", "/dev/mqueue", "mqueue"))
return -1;
return 0;
}