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
9d28c4f9
Unverified
Commit
9d28c4f9
authored
Jul 31, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
devpts: use max=<count> option on mount
This will only work with kernels >= 3.4 Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
d1f811d5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
1 deletion
+8
-1
conf.c
src/lxc/conf.c
+7
-1
console.c
src/tests/console.c
+1
-0
No files found.
src/lxc/conf.c
View file @
9d28c4f9
...
@@ -1332,7 +1332,8 @@ static int setup_pivot_root(const struct lxc_rootfs *rootfs)
...
@@ -1332,7 +1332,8 @@ static int setup_pivot_root(const struct lxc_rootfs *rootfs)
static
int
lxc_setup_devpts
(
int
num_pts
)
static
int
lxc_setup_devpts
(
int
num_pts
)
{
{
int
ret
;
int
ret
;
const
char
*
devpts_mntopts
=
"newinstance,ptmxmode=0666,mode=0620,gid=5"
;
const
char
*
default_devpts_mntopts
=
"newinstance,ptmxmode=0666,mode=0620,gid=5"
;
char
devpts_mntopts
[
256
];
if
(
!
num_pts
)
{
if
(
!
num_pts
)
{
DEBUG
(
"no new devpts instance will be mounted since no pts "
DEBUG
(
"no new devpts instance will be mounted since no pts "
...
@@ -1340,6 +1341,11 @@ static int lxc_setup_devpts(int num_pts)
...
@@ -1340,6 +1341,11 @@ static int lxc_setup_devpts(int num_pts)
return
0
;
return
0
;
}
}
ret
=
snprintf
(
devpts_mntopts
,
sizeof
(
devpts_mntopts
),
"%s,max=%d"
,
default_devpts_mntopts
,
num_pts
);
if
(
ret
<
0
||
(
size_t
)
ret
>=
sizeof
(
devpts_mntopts
))
return
-
1
;
/* Unmount old devpts instance. */
/* Unmount old devpts instance. */
ret
=
access
(
"/dev/pts/ptmx"
,
F_OK
);
ret
=
access
(
"/dev/pts/ptmx"
,
F_OK
);
if
(
!
ret
)
{
if
(
!
ret
)
{
...
...
src/tests/console.c
View file @
9d28c4f9
...
@@ -146,6 +146,7 @@ static int test_console(const char *lxcpath,
...
@@ -146,6 +146,7 @@ static int test_console(const char *lxcpath,
}
}
c
->
load_config
(
c
,
NULL
);
c
->
load_config
(
c
,
NULL
);
c
->
set_config_item
(
c
,
"lxc.tty.max"
,
TTYCNT_STR
);
c
->
set_config_item
(
c
,
"lxc.tty.max"
,
TTYCNT_STR
);
c
->
set_config_item
(
c
,
"lxc.pty.max"
,
"1024"
);
c
->
save_config
(
c
,
NULL
);
c
->
save_config
(
c
,
NULL
);
c
->
want_daemonize
(
c
,
true
);
c
->
want_daemonize
(
c
,
true
);
if
(
!
c
->
startl
(
c
,
0
,
NULL
))
{
if
(
!
c
->
startl
(
c
,
0
,
NULL
))
{
...
...
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