Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
L
lxc
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Chen Yisong
lxc
Commits
d931b243
Unverified
Commit
d931b243
authored
Feb 27, 2018
by
Christian Brauner
Committed by
GitHub
Feb 27, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2194 from hallyn/2018-02-27/lxcinit-umountdev
lxc_init: don't mount filesystems
parents
9e49a491
0011e097
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
43 deletions
+0
-43
lxc_init.c
src/lxc/cmd/lxc_init.c
+0
-2
initutils.c
src/lxc/initutils.c
+0
-41
No files found.
src/lxc/cmd/lxc_init.c
View file @
d931b243
...
...
@@ -318,8 +318,6 @@ int main(int argc, char *argv[])
}
}
lxc_setup_fs
();
remove_self
();
pid
=
fork
();
...
...
src/lxc/initutils.c
View file @
d931b243
...
...
@@ -28,47 +28,6 @@
lxc_log_define
(
lxc_initutils
,
lxc
);
static
int
mount_fs
(
const
char
*
source
,
const
char
*
target
,
const
char
*
type
)
{
/* the umount may fail */
if
(
umount
(
target
))
WARN
(
"Failed to unmount %s : %s"
,
target
,
strerror
(
errno
));
if
(
mount
(
source
,
target
,
type
,
0
,
NULL
))
{
ERROR
(
"Failed to mount %s : %s"
,
target
,
strerror
(
errno
));
return
-
1
;
}
DEBUG
(
"'%s' mounted on '%s'"
,
source
,
target
);
return
0
;
}
extern
void
lxc_setup_fs
(
void
)
{
if
(
mount_fs
(
"proc"
,
"/proc"
,
"proc"
))
INFO
(
"Failed to remount proc"
);
/* if /dev has been populated by us, /dev/shm does not exist */
if
(
access
(
"/dev/shm"
,
F_OK
)
&&
mkdir
(
"/dev/shm"
,
0777
))
INFO
(
"Failed to create /dev/shm"
);
/* if we can't mount /dev/shm, continue anyway */
if
(
mount_fs
(
"shmfs"
,
"/dev/shm"
,
"tmpfs"
))
INFO
(
"Failed to mount /dev/shm"
);
/* If we were able to mount /dev/shm, then /dev exists */
/* Sure, but it's read-only per config :) */
if
(
access
(
"/dev/mqueue"
,
F_OK
)
&&
mkdir
(
"/dev/mqueue"
,
0666
))
{
DEBUG
(
"Failed to create '/dev/mqueue'"
);
return
;
}
/* continue even without posix message queue support */
if
(
mount_fs
(
"mqueue"
,
"/dev/mqueue"
,
"mqueue"
))
INFO
(
"Failed to mount /dev/mqueue"
);
}
static
char
*
copy_global_config_value
(
char
*
p
)
{
int
len
=
strlen
(
p
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment