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
21d298c1
Unverified
Commit
21d298c1
authored
Oct 02, 2018
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
utils: fix lxc_set_death_signal()
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
40671e8e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
start.c
src/lxc/start.c
+2
-2
utils.c
src/lxc/utils.c
+3
-6
utils.h
src/lxc/utils.h
+1
-1
No files found.
src/lxc/start.c
View file @
21d298c1
...
...
@@ -1052,7 +1052,7 @@ static int do_start(void *data)
* exit before we set the pdeath signal leading to a unsupervized
* container.
*/
ret
=
lxc_set_death_signal
(
SIGKILL
);
ret
=
lxc_set_death_signal
(
SIGKILL
,
0
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to set PR_SET_PDEATHSIG to SIGKILL"
);
goto
out_warn_father
;
...
...
@@ -1130,7 +1130,7 @@ static int do_start(void *data)
goto
out_warn_father
;
/* set{g,u}id() clears deathsignal */
ret
=
lxc_set_death_signal
(
SIGKILL
);
ret
=
lxc_set_death_signal
(
SIGKILL
,
0
);
if
(
ret
<
0
)
{
SYSERROR
(
"Failed to set PR_SET_PDEATHSIG to SIGKILL"
);
goto
out_warn_father
;
...
...
src/lxc/utils.c
View file @
21d298c1
...
...
@@ -1645,7 +1645,7 @@ uint64_t lxc_find_next_power2(uint64_t n)
return
n
;
}
int
lxc_set_death_signal
(
int
signal
)
int
lxc_set_death_signal
(
int
signal
,
pid_t
parent
)
{
int
ret
;
pid_t
ppid
;
...
...
@@ -1655,11 +1655,8 @@ int lxc_set_death_signal(int signal)
/* Check whether we have been orphaned. */
ppid
=
(
pid_t
)
syscall
(
SYS_getppid
);
if
(
ppid
==
1
)
{
pid_t
self
;
self
=
lxc_raw_getpid
();
ret
=
kill
(
self
,
SIGKILL
);
if
(
ppid
!=
parent
)
{
ret
=
raise
(
SIGKILL
);
if
(
ret
<
0
)
return
-
1
;
}
...
...
src/lxc/utils.h
View file @
21d298c1
...
...
@@ -433,7 +433,7 @@ static inline pid_t lxc_raw_gettid(void)
}
/* Set a signal the child process will receive after the parent has died. */
extern
int
lxc_set_death_signal
(
int
signal
);
extern
int
lxc_set_death_signal
(
int
signal
,
pid_t
parent
);
extern
int
fd_cloexec
(
int
fd
,
bool
cloexec
);
extern
int
recursive_destroy
(
char
*
dirname
);
extern
int
lxc_setup_keyring
(
void
);
...
...
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