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
2c4bb8e3
Unverified
Commit
2c4bb8e3
authored
Sep 10, 2017
by
Christian Brauner
Committed by
Stéphane Graber
Sep 24, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
execute: enable console & standard /dev symlinks
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
e4f0f03d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
15 deletions
+8
-15
conf.c
src/lxc/conf.c
+8
-5
console.c
src/lxc/console.c
+0
-10
No files found.
src/lxc/conf.c
View file @
2c4bb8e3
...
@@ -782,7 +782,7 @@ static const struct dev_symlinks dev_symlinks[] = {
...
@@ -782,7 +782,7 @@ static const struct dev_symlinks dev_symlinks[] = {
{
"/proc/self/fd/2"
,
"stderr"
},
{
"/proc/self/fd/2"
,
"stderr"
},
};
};
static
int
setup_dev_symlinks
(
const
struct
lxc_rootfs
*
rootfs
)
static
int
lxc_
setup_dev_symlinks
(
const
struct
lxc_rootfs
*
rootfs
)
{
{
char
path
[
MAXPATHLEN
];
char
path
[
MAXPATHLEN
];
int
ret
,
i
;
int
ret
,
i
;
...
@@ -3220,13 +3220,16 @@ int lxc_setup(struct lxc_handler *handler)
...
@@ -3220,13 +3220,16 @@ int lxc_setup(struct lxc_handler *handler)
}
}
}
}
if
(
!
lxc_conf
->
is_execute
&&
lxc_setup_console
(
&
lxc_conf
->
rootfs
,
&
lxc_conf
->
console
,
lxc_conf
->
ttydir
))
{
ret
=
lxc_setup_console
(
&
lxc_conf
->
rootfs
,
&
lxc_conf
->
console
,
ERROR
(
"failed to setup the console for '%s'"
,
name
);
lxc_conf
->
ttydir
);
if
(
ret
<
0
)
{
ERROR
(
"Failed to setup console"
);
return
-
1
;
return
-
1
;
}
}
if
(
!
lxc_conf
->
is_execute
&&
setup_dev_symlinks
(
&
lxc_conf
->
rootfs
))
{
ret
=
lxc_setup_dev_symlinks
(
&
lxc_conf
->
rootfs
);
ERROR
(
"failed to setup /dev symlinks for '%s'"
,
name
);
if
(
ret
<
0
)
{
ERROR
(
"Failed to setup /dev symlinks"
);
return
-
1
;
return
-
1
;
}
}
...
...
src/lxc/console.c
View file @
2c4bb8e3
...
@@ -228,11 +228,6 @@ extern int lxc_console_mainloop_add(struct lxc_epoll_descr *descr,
...
@@ -228,11 +228,6 @@ extern int lxc_console_mainloop_add(struct lxc_epoll_descr *descr,
{
{
struct
lxc_console
*
console
=
&
conf
->
console
;
struct
lxc_console
*
console
=
&
conf
->
console
;
if
(
conf
->
is_execute
)
{
INFO
(
"no console for lxc-execute."
);
return
0
;
}
if
(
!
conf
->
rootfs
.
path
)
{
if
(
!
conf
->
rootfs
.
path
)
{
INFO
(
"no rootfs, no console."
);
INFO
(
"no rootfs, no console."
);
return
0
;
return
0
;
...
@@ -526,11 +521,6 @@ int lxc_console_create(struct lxc_conf *conf)
...
@@ -526,11 +521,6 @@ int lxc_console_create(struct lxc_conf *conf)
struct
lxc_console
*
console
=
&
conf
->
console
;
struct
lxc_console
*
console
=
&
conf
->
console
;
int
ret
;
int
ret
;
if
(
conf
->
is_execute
)
{
INFO
(
"not allocating a console device for lxc-execute."
);
return
0
;
}
if
(
!
conf
->
rootfs
.
path
)
{
if
(
!
conf
->
rootfs
.
path
)
{
INFO
(
"container does not have a rootfs, console device will be shared with the host"
);
INFO
(
"container does not have a rootfs, console device will be shared with the host"
);
return
0
;
return
0
;
...
...
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