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
958f5c9e
Commit
958f5c9e
authored
Jul 20, 2009
by
Daniel Lezcano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
isolate the shmfs for the container
The /dev/shm is not isolated for application container, so mount it in the container. Signed-off-by:
Daniel Lezcano
<
dlezcano@fr.ibm.com
>
parent
af795875
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
3 deletions
+25
-3
lxc_init.c
src/lxc/lxc_init.c
+25
-3
No files found.
src/lxc/lxc_init.c
View file @
958f5c9e
...
...
@@ -48,6 +48,30 @@ static struct option options[] = {
{
0
,
0
,
0
,
0
},
};
static
int
mount_fs
(
const
char
*
source
,
const
char
*
target
,
const
char
*
type
)
{
/* sometimes the umount fails */
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
;
}
return
0
;
}
static
inline
int
setup_fs
(
void
)
{
if
(
mount_fs
(
"proc"
,
"/proc"
,
"proc"
))
return
-
1
;
if
(
mount_fs
(
"shmfs"
,
"/dev/shm"
,
"tmpfs"
))
return
-
1
;
return
0
;
}
int
main
(
int
argc
,
char
*
argv
[])
{
pid_t
pid
;
...
...
@@ -87,10 +111,8 @@ int main(int argc, char *argv[])
if
(
!
pid
)
{
if
(
mount
(
"proc"
,
"/proc"
,
"proc"
,
0
,
NULL
))
{
ERROR
(
"failed to mount '/proc' : %s"
,
strerror
(
errno
));
if
(
setup_fs
())
exit
(
err
);
}
execvp
(
aargv
[
0
],
aargv
);
ERROR
(
"failed to exec: '%s' : %s"
,
aargv
[
0
],
strerror
(
errno
));
...
...
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