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
fe1c5887
Unverified
Commit
fe1c5887
authored
Jul 02, 2017
by
Christian Brauner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
confile: lxc.tty --> lxc.tty.max
Signed-off-by:
Christian Brauner
<
christian.brauner@ubuntu.com
>
parent
2e44ae28
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
55 additions
and
35 deletions
+55
-35
archlinux.common.conf.in
config/templates/archlinux.common.conf.in
+1
-1
common.conf.in
config/templates/common.conf.in
+1
-1
openwrt.common.conf.in
config/templates/openwrt.common.conf.in
+1
-1
sabayon.common.conf.in
config/templates/sabayon.common.conf.in
+1
-1
voidlinux.common.conf.in
config/templates/voidlinux.common.conf.in
+1
-1
lxc.container.conf.sgml.in
doc/lxc.container.conf.sgml.in
+2
-2
conf.h
src/lxc/conf.h
+2
-1
confile.c
src/lxc/confile.c
+13
-8
console.h
src/lxc/console.h
+4
-4
console.c
src/tests/console.c
+1
-1
get_item.c
src/tests/get_item.c
+5
-0
lxc-test-checkpoint-restore
src/tests/lxc-test-checkpoint-restore
+1
-1
parse_config_file.c
src/tests/parse_config_file.c
+10
-1
lxc-altlinux.in
templates/lxc-altlinux.in
+1
-1
lxc-archlinux.in
templates/lxc-archlinux.in
+1
-1
lxc-busybox.in
templates/lxc-busybox.in
+1
-1
lxc-cirros.in
templates/lxc-cirros.in
+1
-1
lxc-debian.in
templates/lxc-debian.in
+4
-4
lxc-gentoo.in
templates/lxc-gentoo.in
+1
-1
lxc-openmandriva.in
templates/lxc-openmandriva.in
+1
-1
lxc-pld.in
templates/lxc-pld.in
+2
-2
No files found.
config/templates/archlinux.common.conf.in
View file @
fe1c5887
...
...
@@ -2,7 +2,7 @@
lxc.include = @LXCTEMPLATECONFIG@/common.conf
# Allow for 6 tty devices by default
lxc.tty = 6
lxc.tty
.max
= 6
# Set the halt/stop signals
lxc.signal.halt=SIGRTMIN+4
...
...
config/templates/common.conf.in
View file @
fe1c5887
...
...
@@ -7,7 +7,7 @@ lxc.tty.dir = lxc
lxc.pts = 1024
# Setup 4 tty devices
lxc.tty = 4
lxc.tty
.max
= 4
# Drop some harmful capabilities
lxc.cap.drop = mac_admin mac_override sys_time sys_module sys_rawio
...
...
config/templates/openwrt.common.conf.in
View file @
fe1c5887
# Default console settings
lxc.tty.dir = lxc
lxc.tty = 4
lxc.tty
.max
= 4
lxc.pts = 1024
# Default capabilities
...
...
config/templates/sabayon.common.conf.in
View file @
fe1c5887
...
...
@@ -7,7 +7,7 @@ lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed
lxc.pts = 1024
# Setup 1 tty devices for lxc-console command
lxc.tty = 1
lxc.tty
.max
= 1
# Needed for systemd distro
lxc.autodev = 1
...
...
config/templates/voidlinux.common.conf.in
View file @
fe1c5887
...
...
@@ -2,7 +2,7 @@
lxc.include = @LXCTEMPLATECONFIG@/common.conf
# Allow for 6 tty devices by default
lxc.tty = 6
lxc.tty
.max
= 6
# Set $VIRTUALIZATION so runit doesn't try to mount filesystems or start udevd
lxc.environment=VIRTUALIZATION=lxc
...
...
doc/lxc.container.conf.sgml.in
View file @
fe1c5887
...
...
@@ -718,7 +718,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<variablelist>
<varlistentry>
<term>
<option>lxc.tty</option>
<option>lxc.tty
.max
</option>
</term>
<listitem>
<para>
...
...
@@ -747,7 +747,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<variablelist>
<varlistentry>
<term>
<option>lxc.
devtty
dir</option>
<option>lxc.
tty.
dir</option>
</term>
<listitem>
<para>
...
...
src/lxc/conf.h
View file @
fe1c5887
...
...
@@ -330,7 +330,8 @@ struct lxc_conf {
struct
lxc_list
caps
;
struct
lxc_list
keepcaps
;
struct
lxc_tty_info
tty_info
;
char
*
pty_names
;
// comma-separated list of lxc.tty pty names
/* Comma-separated list of lxc.tty.max pty names. */
char
*
pty_names
;
struct
lxc_console
console
;
struct
lxc_rootfs
rootfs
;
char
*
ttydir
;
...
...
src/lxc/confile.c
View file @
fe1c5887
...
...
@@ -76,7 +76,7 @@ lxc_log_define(lxc_confile, lxc);
lxc_config_define
(
personality
);
lxc_config_define
(
pts
);
lxc_config_define
(
tty
);
lxc_config_define
(
tty
_max
);
lxc_config_define
(
tty_dir
);
lxc_config_define
(
apparmor_profile
);
lxc_config_define
(
apparmor_allow_incomplete
);
...
...
@@ -137,13 +137,18 @@ static struct lxc_config_t config[] = {
{
"lxc.arch"
,
set_config_personality
,
get_config_personality
,
clr_config_personality
,
},
{
"lxc.pts"
,
set_config_pts
,
get_config_pts
,
clr_config_pts
,
},
{
"lxc.tty.dir"
,
set_config_tty_dir
,
get_config_tty_dir
,
clr_config_tty_dir
,
},
{
"lxc.tty.max"
,
set_config_tty_max
,
get_config_tty_max
,
clr_config_tty_max
,
},
/* REMOVE IN LXC 3.0
legacy devttydir key
*/
{
"lxc.devttydir"
,
set_config_tty_dir
,
get_config_tty_dir
,
clr_config_tty_dir
,
},
{
"lxc.tty"
,
set_config_tty
,
get_config_tty
,
clr_config_tty
,
},
/* REMOVE IN LXC 3.0
legacy tty key
*/
{
"lxc.tty"
,
set_config_tty_max
,
get_config_tty_max
,
clr_config_tty_max
,
},
{
"lxc.apparmor.profile"
,
set_config_apparmor_profile
,
get_config_apparmor_profile
,
clr_config_apparmor_profile
,
},
{
"lxc.apparmor.allow_incomplete"
,
set_config_apparmor_allow_incomplete
,
get_config_apparmor_allow_incomplete
,
clr_config_apparmor_allow_incomplete
,
},
{
"lxc.selinux.context"
,
set_config_selinux_context
,
get_config_selinux_context
,
clr_config_selinux_context
,
},
...
...
@@ -1313,8 +1318,8 @@ on_error:
return
-
1
;
}
static
int
set_config_tty
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
static
int
set_config_tty
_max
(
const
char
*
key
,
const
char
*
value
,
struct
lxc_conf
*
lxc_conf
,
void
*
data
)
{
/* Set config value to default. */
if
(
lxc_config_value_empty
(
value
))
{
...
...
@@ -2795,8 +2800,8 @@ static int get_config_pts(const char *key, char *retv, int inlen,
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
pts
);
}
static
int
get_config_tty
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
struct
lxc_conf
*
c
,
void
*
data
)
static
int
get_config_tty
_max
(
const
char
*
key
,
char
*
retv
,
int
inlen
,
struct
lxc_conf
*
c
,
void
*
data
)
{
return
lxc_get_conf_int
(
c
,
retv
,
inlen
,
c
->
tty
);
}
...
...
@@ -3368,8 +3373,8 @@ static inline int clr_config_pts(const char *key, struct lxc_conf *c,
return
0
;
}
static
inline
int
clr_config_tty
(
const
char
*
key
,
struct
lxc_conf
*
c
,
void
*
data
)
static
inline
int
clr_config_tty
_max
(
const
char
*
key
,
struct
lxc_conf
*
c
,
void
*
data
)
{
c
->
tty
=
0
;
return
0
;
...
...
src/lxc/console.h
View file @
fe1c5887
...
...
@@ -110,7 +110,7 @@ extern int lxc_console_mainloop_add(struct lxc_epoll_descr *, struct lxc_conf *
extern
void
lxc_console_sigwinch
(
int
sig
);
/*
* Connect to one of the ptys given to the container via lxc.tty.
* Connect to one of the ptys given to the container via lxc.tty.
max.
* - allocates either the current controlling pty (default) or a user specified
* pty as peer pty for the containers tty
* - sets up SIGWINCH handler, winsz, and new terminal settings
...
...
@@ -123,10 +123,10 @@ extern int lxc_console(struct lxc_container *c, int ttynum,
int
escape
);
/*
* Allocate one of the ptys given to the container via lxc.tty.
Returns an ope
n
* fd to the allocated pty.
* Allocate one of the ptys given to the container via lxc.tty.
max. Returns a
n
*
open
fd to the allocated pty.
* Set ttynum to -1 to allocate the first available pty, or to a value within
* the range specified by lxc.tty to allocate a specific pty.
* the range specified by lxc.tty
.max
to allocate a specific pty.
*/
extern
int
lxc_console_getfd
(
struct
lxc_container
*
c
,
int
*
ttynum
,
int
*
masterfd
);
...
...
src/tests/console.c
View file @
fe1c5887
...
...
@@ -145,7 +145,7 @@ static int test_console(const char *lxcpath,
goto
out2
;
}
c
->
load_config
(
c
,
NULL
);
c
->
set_config_item
(
c
,
"lxc.tty"
,
TTYCNT_STR
);
c
->
set_config_item
(
c
,
"lxc.tty
.max
"
,
TTYCNT_STR
);
c
->
save_config
(
c
,
NULL
);
c
->
want_daemonize
(
c
,
true
);
if
(
!
c
->
startl
(
c
,
0
,
NULL
))
{
...
...
src/tests/get_item.c
View file @
fe1c5887
...
...
@@ -83,6 +83,11 @@ int main(int argc, char *argv[])
goto
out
;
}
fprintf
(
stderr
,
"%d: get_config_item(lxc.network) returned %d %s
\n
"
,
__LINE__
,
ret
,
v2
);
/* REMOVE IN LXC 3.0
legacy lxc.tty key
*/
if
(
!
c
->
set_config_item
(
c
,
"lxc.tty"
,
"4"
))
{
fprintf
(
stderr
,
"%d: failed to set tty
\n
"
,
__LINE__
);
goto
out
;
...
...
src/tests/lxc-test-checkpoint-restore
View file @
fe1c5887
...
...
@@ -32,7 +32,7 @@ lxc-create -t ubuntu -n $name || FAIL "creating container"
cat
>>
"
$(
lxc-config lxc.lxcpath
)
/
$name
/config"
<<
EOF
# hax for criu
lxc.console.path = none
lxc.tty = 0
lxc.tty
.max
= 0
lxc.cgroup.devices.deny = c 5:1 rwm
EOF
...
...
src/tests/parse_config_file.c
View file @
fe1c5887
...
...
@@ -307,13 +307,22 @@ int main(int argc, char *argv[])
goto
non_test_error
;
}
/* lxc.tty */
/* REMOVE IN LXC 3.0
legacy tty.max keys
*/
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.tty"
,
"4"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.tty"
);
goto
non_test_error
;
}
/* lxc.tty.max */
if
(
set_get_compare_clear_save_load
(
c
,
"lxc.tty.max"
,
"4"
,
tmpf
,
true
)
<
0
)
{
lxc_error
(
"%s
\n
"
,
"lxc.tty.max"
);
goto
non_test_error
;
}
/* REMOVE IN LXC 3.0
legacy devttydir keys
*/
...
...
templates/lxc-altlinux.in
View file @
fe1c5887
...
...
@@ -277,7 +277,7 @@ copy_configuration()
grep
-q
"^lxc.rootfs.path"
$config_path
/config 2>/dev/null
||
echo
"lxc.rootfs.path =
$rootfs_path
"
>>
$config_path
/config
cat
<<
EOF
>>
$config_path
/config
lxc.uts.name =
$name
lxc.tty = 4
lxc.tty
.max
= 4
lxc.pts = 1024
lxc.cap.drop = sys_module mac_admin mac_override sys_time
...
...
templates/lxc-archlinux.in
View file @
fe1c5887
...
...
@@ -121,7 +121,7 @@ systemctl enable systemd-resolved
ln -sf /run/systemd/resolve/resolv.conf /etc/resolv.conf
EOF
# enable getty on active ttys
local
nttys
=
$(
cat
"
${
config_path
}
/config"
${
shared_config
}
${
common_config
}
|
grep
"^lxc.tty"
|
head
-n1
|
cut
-d
=
-f2
|
tr
-d
"[:blank:]"
)
local
nttys
=
$(
cat
"
${
config_path
}
/config"
${
shared_config
}
${
common_config
}
|
grep
"^lxc.tty
.max
"
|
head
-n1
|
cut
-d
=
-f2
|
tr
-d
"[:blank:]"
)
local
devttydir
=
$(
cat
"
${
config_path
}
/config"
${
shared_config
}
${
common_config
}
|
grep
"^lxc.tty.dir"
|
head
-n1
|
cut
-d
=
-f2
|
tr
-d
"[:blank:]"
)
local
devtty
=
""
# bind getty instances to /dev/<devttydir>/tty* if lxc.tty.dir is set
...
...
templates/lxc-busybox.in
View file @
fe1c5887
...
...
@@ -344,7 +344,7 @@ cat <<EOF >> $path/config
lxc.signal.halt = SIGUSR1
lxc.rebootsignal = SIGTERM
lxc.uts.name =
$name
lxc.tty = 1
lxc.tty
.max
= 1
lxc.pts = 1
lxc.cap.drop = sys_module mac_admin mac_override sys_time
...
...
templates/lxc-cirros.in
View file @
fe1c5887
...
...
@@ -120,7 +120,7 @@ cat >> "$path/config" <<EOF
lxc.rootfs.path =
$rootfs
lxc.tty = 4
lxc.tty
.max
= 4
lxc.pts = 1024
lxc.uts.name =
$name
...
...
templates/lxc-debian.in
View file @
fe1c5887
...
...
@@ -265,7 +265,7 @@ configure_debian_systemd()
chroot
"
${
rootfs
}
"
ln
-s
/dev/null /etc/systemd/system/systemd-udevd.service
chroot
"
${
rootfs
}
"
ln
-s
/lib/systemd/system/multi-user.target /etc/systemd/system/default.target
# Setup getty service on the ttys we are going to allow in the
# default config. Number should match lxc.tty
# default config. Number should match lxc.tty
.max
(
cd
"
${
rootfs
}
/etc/systemd/system/getty.target.wants"
for
i
in
$(
seq
1
"
$num_tty
"
)
;
do
ln
-sf
../getty
\@
.service getty@tty
"
${
i
}
"
.service
;
done
)
...
...
@@ -514,7 +514,7 @@ copy_configuration()
grep
-q
"^lxc.rootfs.path"
"
$path
/config"
2> /dev/null
||
echo
"lxc.rootfs.path =
$rootfs
"
>>
"
$path
/config"
cat
<<
EOF
>>
$path
/config
lxc.tty =
$num_tty
lxc.tty
.max
=
$num_tty
lxc.uts.name =
$hostname
lxc.arch =
$arch
lxc.pts=1023
...
...
@@ -795,8 +795,8 @@ if [ -z "$rootfs" ]; then
fi
# determine the number of ttys - default is 4
if
grep
-q
'^lxc.tty'
"
$config
"
2> /dev/null
;
then
num_tty
=
$(
awk
-F
=
'/^lxc.tty[ \t]+=/{ print $2 }'
"
$config
"
)
if
grep
-q
'^lxc.tty
.max
'
"
$config
"
2> /dev/null
;
then
num_tty
=
$(
awk
-F
=
'/^lxc.tty
.max
[ \t]+=/{ print $2 }'
"
$config
"
)
else
num_tty
=
4
fi
...
...
templates/lxc-gentoo.in
View file @
fe1c5887
...
...
@@ -706,7 +706,7 @@ ${conf_arch_line}
# set the hostname
lxc.uts.name =
${
name
}
lxc.tty =
${
tty
}
lxc.tty
.max
=
${
tty
}
${
conf_rootfs_line
}
${
portage_mount
}
...
...
templates/lxc-openmandriva.in
View file @
fe1c5887
...
...
@@ -229,7 +229,7 @@ copy_configuration()
grep
-q
"^lxc.rootfs.path"
$config_path
/config 2>/dev/null
||
echo
"lxc.rootfs.path =
$rootfs_path
"
>>
$config_path
/config
cat
<<
EOF
>>
$config_path
/config
lxc.uts.name =
$name
lxc.tty = 4
lxc.tty
.max
= 4
lxc.pts = 1024
lxc.cap.drop = sys_module mac_admin mac_override sys_time
lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed
...
...
templates/lxc-pld.in
View file @
fe1c5887
...
...
@@ -138,7 +138,7 @@ configure_pld_systemd()
>
${
rootfs_path
}
/etc/systemd/system/getty@.service
# Setup getty service on the 4 ttys we are going to allow in the
# default config. Number should match lxc.tty
# default config. Number should match lxc.tty
.max
for
i
in
1 2 3 4
;
do
ln
-sf
../getty@.service
${
rootfs_path
}
/etc/systemd/system/getty.target.wants/getty@tty
${
i
}
.service
done
...
...
@@ -239,7 +239,7 @@ copy_configuration()
# Most of below settings should be taken as defaults from
# lxc.include = /usr/share/lxc/config/common.conf
lxc.uts.name =
$utsname
lxc.tty = 4
lxc.tty
.max
= 4
lxc.pts = 1024
# Consider if below line is right for systemd container
lxc.mount.fstab =
$config_path
/fstab
...
...
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