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
e9be1c7a
Unverified
Commit
e9be1c7a
authored
Jun 11, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Jul 16, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lxccontainer: cleanup + bugfixes
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
081f3eb4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
lxccontainer.c
src/lxc/lxccontainer.c
+13
-7
No files found.
src/lxc/lxccontainer.c
View file @
e9be1c7a
...
...
@@ -737,17 +737,17 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
if
(
!
c
->
lxc_conf
)
return
false
;
if
((
ret
=
ongoing_create
(
c
))
<
0
)
{
ret
=
ongoing_create
(
c
);
if
(
ret
<
0
)
{
ERROR
(
"Error checking for incomplete creation"
);
return
false
;
}
if
(
ret
==
2
)
{
ERROR
(
"Error: %s creation was not completed"
,
c
->
name
);
do_lxcapi_destroy
(
c
);
return
false
;
}
else
if
(
ret
==
1
)
{
ERROR
(
"Error: creation of %s is ongoing"
,
c
->
name
);
return
false
;
}
else
if
(
ret
==
2
)
{
ERROR
(
"Error: %s creation was not completed"
,
c
->
name
);
do_lxcapi_destroy
(
c
);
return
false
;
}
/* is this app meant to be run through lxcinit, as in lxc-execute? */
...
...
@@ -790,9 +790,11 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
*/
if
(
daemonize
)
{
char
title
[
2048
];
pid_t
pid
;
pid
_t
pid
=
fork
();
pid
=
fork
();
if
(
pid
<
0
)
{
free_init_cmd
(
init_cmd
);
lxc_free_handler
(
handler
);
return
false
;
}
...
...
@@ -849,6 +851,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
if
(
pid_fp
==
NULL
)
{
SYSERROR
(
"Failed to create pidfile '%s' for '%s'"
,
c
->
pidfile
,
c
->
name
);
free_init_cmd
(
init_cmd
);
lxc_free_handler
(
handler
);
if
(
daemonize
)
exit
(
1
);
...
...
@@ -859,6 +862,7 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
SYSERROR
(
"Failed to write '%s'"
,
c
->
pidfile
);
fclose
(
pid_fp
);
pid_fp
=
NULL
;
free_init_cmd
(
init_cmd
);
lxc_free_handler
(
handler
);
if
(
daemonize
)
exit
(
1
);
...
...
@@ -875,11 +879,13 @@ static bool do_lxcapi_start(struct lxc_container *c, int useinit, char * const a
if
(
conf
->
monitor_unshare
)
{
if
(
unshare
(
CLONE_NEWNS
))
{
SYSERROR
(
"failed to unshare mount namespace"
);
free_init_cmd
(
init_cmd
);
lxc_free_handler
(
handler
);
return
false
;
}
if
(
mount
(
NULL
,
"/"
,
NULL
,
MS_SLAVE
|
MS_REC
,
NULL
))
{
SYSERROR
(
"Failed to make / rslave at startup"
);
free_init_cmd
(
init_cmd
);
lxc_free_handler
(
handler
);
return
false
;
}
...
...
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