mirror of
git://github.com/lxc/lxc
synced 2025-09-01 08:57:42 +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:
@@ -27,7 +27,7 @@
|
|||||||
|
|
||||||
LXC_CREATE_CAPS="cap_sys_admin"
|
LXC_CREATE_CAPS="cap_sys_admin"
|
||||||
LXC_NETSTAT_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_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_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
|
LXC_EXECUTE_CAPS=$LXC_START_CAPS
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#include <libgen.h>
|
#include <libgen.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
#include <sys/mount.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)
|
static int mount_fs(const char *source, const char *target, const char *type)
|
||||||
{
|
{
|
||||||
/* sometimes the umount fails */
|
/* the umount may fail */
|
||||||
if (umount(target))
|
if (umount(target))
|
||||||
WARN("failed to unmount %s : %s", target, strerror(errno));
|
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"))
|
if (mount_fs("shmfs", "/dev/shm", "tmpfs"))
|
||||||
return -1;
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user