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
9668d2cd
Unverified
Commit
9668d2cd
authored
Dec 18, 2017
by
Serge Hallyn
Committed by
GitHub
Dec 18, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2049 from brauner/2017-12-18/start_reap_attacher_process
start: reap intermediate process
parents
9aff2c83
4e232466
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
5 deletions
+21
-5
error.h
src/lxc/error.h
+2
-0
start.c
src/lxc/start.c
+19
-5
No files found.
src/lxc/error.h
View file @
9668d2cd
...
@@ -23,6 +23,8 @@
...
@@ -23,6 +23,8 @@
#ifndef __LXC_ERROR_H
#ifndef __LXC_ERROR_H
#define __LXC_ERROR_H
#define __LXC_ERROR_H
#define LXC_CLONE_ERROR "Failed to clone a new set of namespaces"
extern
int
lxc_error_set_and_log
(
int
pid
,
int
status
);
extern
int
lxc_error_set_and_log
(
int
pid
,
int
status
);
#endif
#endif
src/lxc/start.c
View file @
9668d2cd
...
@@ -1399,14 +1399,28 @@ static int lxc_spawn(struct lxc_handler *handler)
...
@@ -1399,14 +1399,28 @@ static int lxc_spawn(struct lxc_handler *handler)
/* The cgroup namespace gets unshare()ed not clone()ed. */
/* The cgroup namespace gets unshare()ed not clone()ed. */
handler
->
on_clone_flags
&=
~
CLONE_NEWCGROUP
;
handler
->
on_clone_flags
&=
~
CLONE_NEWCGROUP
;
if
(
share_ns
)
if
(
share_ns
)
{
ret
=
lxc_clone
(
do_share_ns
,
handler
,
CLONE_VFORK
|
CLONE_VM
|
CLONE_FILES
);
pid_t
attacher_pid
;
else
attacher_pid
=
lxc_clone
(
do_share_ns
,
handler
,
CLONE_VFORK
|
CLONE_VM
|
CLONE_FILES
);
if
(
attacher_pid
<
0
)
{
SYSERROR
(
LXC_CLONE_ERROR
);
goto
out_delete_net
;
}
ret
=
wait_for_pid
(
attacher_pid
);
if
(
ret
<
0
)
{
SYSERROR
(
"Intermediate process failed"
);
goto
out_delete_net
;
}
}
else
{
handler
->
pid
=
lxc_clone
(
do_start
,
handler
,
handler
->
on_clone_flags
);
handler
->
pid
=
lxc_clone
(
do_start
,
handler
,
handler
->
on_clone_flags
);
if
(
handler
->
pid
<
0
||
ret
<
0
)
{
}
SYSERROR
(
"Failed to clone a new set of namespaces."
);
if
(
handler
->
pid
<
0
)
{
SYSERROR
(
LXC_CLONE_ERROR
);
goto
out_delete_net
;
goto
out_delete_net
;
}
}
TRACE
(
"Cloned child process %d"
,
handler
->
pid
);
TRACE
(
"Cloned child process %d"
,
handler
->
pid
);
for
(
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
for
(
i
=
0
;
i
<
LXC_NS_MAX
;
i
++
)
...
...
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