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
2339fce5
Unverified
Commit
2339fce5
authored
Sep 21, 2018
by
Stéphane Graber
Committed by
GitHub
Sep 21, 2018
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2631 from brauner/2018-09-20/rename_backgrounded
start: s/backgrounded/daemonize/g
parents
2eea2607
bb955810
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
15 deletions
+15
-15
execute.c
src/lxc/execute.c
+2
-2
lxc.h
src/lxc/lxc.h
+4
-4
start.c
src/lxc/start.c
+8
-8
start.h
src/lxc/start.h
+1
-1
No files found.
src/lxc/execute.c
View file @
2339fce5
...
...
@@ -150,12 +150,12 @@ static struct lxc_operations execute_start_ops = {
int
lxc_execute
(
const
char
*
name
,
char
*
const
argv
[],
int
quiet
,
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
,
int
*
error_num
)
bool
daemonize
,
int
*
error_num
)
{
struct
execute_args
args
=
{.
argv
=
argv
,
.
quiet
=
quiet
};
TRACE
(
"Doing lxc_execute"
);
handler
->
conf
->
is_execute
=
true
;
return
__lxc_start
(
name
,
handler
,
&
execute_start_ops
,
&
args
,
lxcpath
,
backgrounded
,
error_num
);
daemonize
,
error_num
);
}
src/lxc/lxc.h
View file @
2339fce5
...
...
@@ -49,12 +49,12 @@ struct lxc_handler;
* @name : the name of the container
* @argv : an array of char * corresponding to the commande line
* @conf : configuration
* @
backgrounded
: whether or not the container is daemonized
* @
daemonize
: whether or not the container is daemonized
* Returns 0 on success, < 0 otherwise
*/
extern
int
lxc_start
(
const
char
*
name
,
char
*
const
argv
[],
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
,
int
*
error_num
);
bool
daemonize
,
int
*
error_num
);
/*
* Start the specified command inside an application container
...
...
@@ -62,12 +62,12 @@ extern int lxc_start(const char *name, char *const argv[],
* @argv : an array of char * corresponding to the commande line
* @quiet : if != 0 then lxc-init won't produce any output
* @conf : configuration
* @
backgrounded
: whether or not the container is daemonized
* @
daemonize
: whether or not the container is daemonized
* Returns 0 on success, < 0 otherwise
*/
extern
int
lxc_execute
(
const
char
*
name
,
char
*
const
argv
[],
int
quiet
,
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
,
int
*
error_num
);
bool
daemonize
,
int
*
error_num
);
/*
* Close the fd associated with the monitoring
...
...
src/lxc/start.c
View file @
2339fce5
...
...
@@ -461,7 +461,7 @@ static int lxc_serve_state_socket_pair(const char *name,
{
ssize_t
ret
;
if
(
!
handler
->
backgrounded
||
if
(
!
handler
->
daemonize
||
handler
->
state_socket_pair
[
1
]
<
0
||
state
==
STARTING
)
return
0
;
...
...
@@ -1168,7 +1168,7 @@ static int do_start(void *data)
* means that migration won't work, but at least we won't spew output
* where it isn't wanted.
*/
if
(
handler
->
backgrounded
&&
!
handler
->
conf
->
autodev
)
{
if
(
handler
->
daemonize
&&
!
handler
->
conf
->
autodev
)
{
ret
=
access
(
path
,
F_OK
);
if
(
ret
!=
0
)
{
devnull_fd
=
open_devnull
();
...
...
@@ -1256,7 +1256,7 @@ static int do_start(void *data)
* make sure that that pty is stdin,stdout,stderr.
*/
if
(
handler
->
conf
->
console
.
slave
>=
0
)
{
if
(
handler
->
backgrounded
||
!
handler
->
conf
->
is_execute
)
if
(
handler
->
daemonize
||
!
handler
->
conf
->
is_execute
)
ret
=
set_stdfds
(
handler
->
conf
->
console
.
slave
);
else
ret
=
lxc_terminal_set_stdfds
(
handler
->
conf
->
console
.
slave
);
...
...
@@ -1283,7 +1283,7 @@ static int do_start(void *data)
close
(
handler
->
sigfd
);
if
(
handler
->
conf
->
console
.
slave
<
0
&&
handler
->
backgrounded
)
{
if
(
handler
->
conf
->
console
.
slave
<
0
&&
handler
->
daemonize
)
{
if
(
devnull_fd
<
0
)
{
devnull_fd
=
open_devnull
();
if
(
devnull_fd
<
0
)
...
...
@@ -1945,7 +1945,7 @@ out_sync_fini:
int
__lxc_start
(
const
char
*
name
,
struct
lxc_handler
*
handler
,
struct
lxc_operations
*
ops
,
void
*
data
,
const
char
*
lxcpath
,
bool
backgrounded
,
int
*
error_num
)
bool
daemonize
,
int
*
error_num
)
{
int
ret
,
status
;
struct
lxc_conf
*
conf
=
handler
->
conf
;
...
...
@@ -1957,7 +1957,7 @@ int __lxc_start(const char *name, struct lxc_handler *handler,
}
handler
->
ops
=
ops
;
handler
->
data
=
data
;
handler
->
backgrounded
=
backgrounded
;
handler
->
daemonize
=
daemonize
;
if
(
!
attach_block_device
(
handler
->
conf
))
{
ERROR
(
"Failed to attach block device"
);
...
...
@@ -2093,14 +2093,14 @@ static struct lxc_operations start_ops = {
};
int
lxc_start
(
const
char
*
name
,
char
*
const
argv
[],
struct
lxc_handler
*
handler
,
const
char
*
lxcpath
,
bool
backgrounded
,
int
*
error_num
)
const
char
*
lxcpath
,
bool
daemonize
,
int
*
error_num
)
{
struct
start_args
start_arg
=
{
.
argv
=
argv
,
};
TRACE
(
"Doing lxc_start"
);
return
__lxc_start
(
name
,
handler
,
&
start_ops
,
&
start_arg
,
lxcpath
,
backgrounded
,
error_num
);
return
__lxc_start
(
name
,
handler
,
&
start_ops
,
&
start_arg
,
lxcpath
,
daemonize
,
error_num
);
}
static
void
lxc_destroy_container_on_signal
(
struct
lxc_handler
*
handler
,
...
...
src/lxc/start.h
View file @
2339fce5
...
...
@@ -98,7 +98,7 @@ struct lxc_handler {
bool
am_root
;
/* Indicates whether should we close std{in,out,err} on start. */
bool
backgrounded
;
bool
daemonize
;
/* The child's pid. */
pid_t
pid
;
...
...
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