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
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
# Default console settings
lxc.tty.dir = lxc
-lxc.tty = 4
+lxc.tty.max = 4
lxc.pts = 1024
# Default capabilities
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
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
<variablelist>
<varlistentry>
<term>
- <option>lxc.tty</option>
+ <option>lxc.tty.max</option>
</term>
<listitem>
<para>
<variablelist>
<varlistentry>
<term>
- <option>lxc.devttydir</option>
+ <option>lxc.tty.dir</option>
</term>
<listitem>
<para>
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;
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);
{ "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, },
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)) {
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);
}
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;
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
int escape);
/*
- * Allocate one of the ptys given to the container via lxc.tty. Returns an open
- * fd to the allocated pty.
+ * Allocate one of the ptys given to the container via lxc.tty.max. Returns an
+ * 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);
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)) {
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;
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
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
*/
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
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
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
lxc.rootfs.path = $rootfs
-lxc.tty = 4
+lxc.tty.max = 4
lxc.pts = 1024
lxc.uts.name = $name
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 )
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
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
# set the hostname
lxc.uts.name = ${name}
-lxc.tty = ${tty}
+lxc.tty.max = ${tty}
${conf_rootfs_line}
${portage_mount}
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
> ${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
# 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