From b67771bc26c999ac97028496e12dd2a4fb133d4e Mon Sep 17 00:00:00 2001 From: 0x0916 Date: Wed, 28 Jun 2017 18:58:16 +0800 Subject: [PATCH] confile: rename lxc.utsname to lxc.uts.name the legacy keys will be kept around until LXC 3.0 and then will be removed. Signed-off-by: 0x0916 --- doc/examples/lxc-complex.conf.in | 2 +- doc/examples/lxc-empty-netns.conf.in | 2 +- doc/examples/lxc-macvlan.conf.in | 2 +- doc/examples/lxc-no-netns.conf.in | 2 +- doc/examples/lxc-phys.conf.in | 2 +- doc/examples/lxc-veth.conf.in | 2 +- doc/examples/lxc-vlan.conf.in | 2 +- doc/ja/lxc.container.conf.sgml.in | 6 +++--- doc/ko/lxc.container.conf.sgml.in | 6 +++--- doc/lxc.container.conf.sgml.in | 6 +++--- src/lua-lxc/test/apitest.lua | 10 +++++----- src/lxc/confile.c | 18 ++++++++++++------ src/lxc/lxccontainer.c | 3 ++- src/python-lxc/examples/api_test.py | 6 +++--- src/tests/parse_config_file.c | 11 ++++++++++- src/tests/startone.c | 4 ++-- templates/lxc-alpine.in | 2 +- templates/lxc-altlinux.in | 2 +- templates/lxc-archlinux.in | 2 +- templates/lxc-busybox.in | 2 +- templates/lxc-centos.in | 2 +- templates/lxc-cirros.in | 2 +- templates/lxc-debian.in | 2 +- templates/lxc-download.in | 2 +- templates/lxc-fedora-legacy.in | 2 +- templates/lxc-fedora.in | 2 +- templates/lxc-gentoo.in | 2 +- templates/lxc-openmandriva.in | 2 +- templates/lxc-opensuse.in | 2 +- templates/lxc-oracle.in | 2 +- templates/lxc-plamo.in | 2 +- templates/lxc-pld.in | 2 +- templates/lxc-sabayon.in | 2 +- templates/lxc-slackware.in | 2 +- templates/lxc-sparclinux.in | 2 +- templates/lxc-sshd.in | 2 +- templates/lxc-ubuntu-cloud.in | 2 +- templates/lxc-ubuntu.in | 2 +- templates/lxc-voidlinux.in | 2 +- 39 files changed, 73 insertions(+), 57 deletions(-) diff --git a/doc/examples/lxc-complex.conf.in b/doc/examples/lxc-complex.conf.in index 70a471b5e..3ae5112d9 100644 --- a/doc/examples/lxc-complex.conf.in +++ b/doc/examples/lxc-complex.conf.in @@ -1,6 +1,6 @@ # Container with network a complex network mixing macvlan, veth and # physical network devices -lxc.utsname = complex +lxc.uts.name = complex lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 diff --git a/doc/examples/lxc-empty-netns.conf.in b/doc/examples/lxc-empty-netns.conf.in index e1f89b53b..f28dff5d5 100644 --- a/doc/examples/lxc-empty-netns.conf.in +++ b/doc/examples/lxc-empty-netns.conf.in @@ -1,4 +1,4 @@ # Container with new network withtout network devices -lxc.utsname = omega +lxc.uts.name = omega lxc.net.0.type = empty lxc.net.0.flags = up diff --git a/doc/examples/lxc-macvlan.conf.in b/doc/examples/lxc-macvlan.conf.in index 2ad078f60..8fc2be944 100644 --- a/doc/examples/lxc-macvlan.conf.in +++ b/doc/examples/lxc-macvlan.conf.in @@ -1,5 +1,5 @@ # Container with network virtualized using the macvlan device driver -lxc.utsname = alpha +lxc.uts.name = alpha lxc.net.0.type = macvlan lxc.net.0.flags = up lxc.net.0.link = eth0 diff --git a/doc/examples/lxc-no-netns.conf.in b/doc/examples/lxc-no-netns.conf.in index ff41c8444..3ba1a396c 100644 --- a/doc/examples/lxc-no-netns.conf.in +++ b/doc/examples/lxc-no-netns.conf.in @@ -1,3 +1,3 @@ # Container with non-virtualized network lxc.net.0.type = none -lxc.utsname = delta +lxc.uts.name = delta diff --git a/doc/examples/lxc-phys.conf.in b/doc/examples/lxc-phys.conf.in index 5bd4cefd6..a92ae986b 100644 --- a/doc/examples/lxc-phys.conf.in +++ b/doc/examples/lxc-phys.conf.in @@ -1,6 +1,6 @@ # Container with network virtualized using a physical network device with name # 'eth0' -lxc.utsname = gamma +lxc.uts.name = gamma lxc.net.0.type = phys lxc.net.0.flags = up lxc.net.0.link = eth0 diff --git a/doc/examples/lxc-veth.conf.in b/doc/examples/lxc-veth.conf.in index e6ccb4f8a..83def3a9e 100644 --- a/doc/examples/lxc-veth.conf.in +++ b/doc/examples/lxc-veth.conf.in @@ -1,6 +1,6 @@ # Container with network virtualized using a pre-configured bridge named br0 and # veth pair virtual network devices -lxc.utsname = beta +lxc.uts.name = beta lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 diff --git a/doc/examples/lxc-vlan.conf.in b/doc/examples/lxc-vlan.conf.in index b660d2b4a..057920c2e 100644 --- a/doc/examples/lxc-vlan.conf.in +++ b/doc/examples/lxc-vlan.conf.in @@ -1,5 +1,5 @@ # Container with network virtualized using the vlan device driver -lxc.utsname = alpha +lxc.uts.name = alpha lxc.net.0.type = vlan lxc.net.0.vlan.id = 1234 lxc.net.0.flags = up diff --git a/doc/ja/lxc.container.conf.sgml.in b/doc/ja/lxc.container.conf.sgml.in index e941fcec7..f03cc24da 100644 --- a/doc/ja/lxc.container.conf.sgml.in +++ b/doc/ja/lxc.container.conf.sgml.in @@ -229,7 +229,7 @@ by KATOH Yasufumi - + @@ -2667,7 +2667,7 @@ by KATOH Yasufumi 仮想ネットワークデバイスは、コンテナ内では eth0 とリネームされます。 - lxc.utsname = myhostname + lxc.uts.name = myhostname lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 @@ -2720,7 +2720,7 @@ by KATOH Yasufumi この例は、control group を使って、複雑なネットワークスタックを作成し、新しいホスト名を指定し、いくつかの場所をマウントし、ルートファイルシステムを変更するような複雑な設定を示します。 - lxc.utsname = complex + lxc.uts.name = complex lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 diff --git a/doc/ko/lxc.container.conf.sgml.in b/doc/ko/lxc.container.conf.sgml.in index 738748b52..40e1513c3 100644 --- a/doc/ko/lxc.container.conf.sgml.in +++ b/doc/ko/lxc.container.conf.sgml.in @@ -187,7 +187,7 @@ by Sungbae Yoo - + @@ -2563,7 +2563,7 @@ mknod errno 0 이 설정은 컨테이너가 한 쪽은 (이전에 시스템에 이미 생성된) br0 브리지에 연결되어 있는 veth 장치 쌍을 사용하도록 세팅한다. 가상 네트워크 장치는 컨테이너 내에서 eth0라는 이름을 갖는다. - lxc.utsname = myhostname + lxc.uts.name = myhostname lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 @@ -2613,7 +2613,7 @@ mknod errno 0 아래의 예제는 복잡한 네트워크 스택, 컨트롤 그룹 사용, 호스트 이름 설정, 몇몇 장소 마운트, 루트 파일시스템 변경 등의 복잡한 설정을 보여준다. - lxc.utsname = complex + lxc.uts.name = complex lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in index 3b639dd7f..6c832c8b2 100644 --- a/doc/lxc.container.conf.sgml.in +++ b/doc/lxc.container.conf.sgml.in @@ -172,7 +172,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + @@ -1932,7 +1932,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA virtual network device visible in the container is renamed to eth0. - lxc.utsname = myhostname + lxc.uts.name = myhostname lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 @@ -1975,7 +1975,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA network stack, using the control groups, setting a new hostname, mounting some locations and a changing root file system. - lxc.utsname = complex + lxc.uts.name = complex lxc.net.0.type = veth lxc.net.0.flags = up lxc.net.0.link = br0 diff --git a/src/lua-lxc/test/apitest.lua b/src/lua-lxc/test/apitest.lua index c4fa4c935..99cded75b 100755 --- a/src/lua-lxc/test/apitest.lua +++ b/src/lua-lxc/test/apitest.lua @@ -233,11 +233,11 @@ function test_config_items() log(0, "Test set/clear configuration items...") -- test setting a 'single type' item - assert(container:get_config_item("lxc.utsname") == optarg["n"]) - container:set_config_item("lxc.utsname", "foobar") - assert(container:get_config_item("lxc.utsname") == "foobar") - container:set_config_item("lxc.utsname", optarg["n"]) - assert(container:get_config_item("lxc.utsname") == optarg["n"]) + assert(container:get_config_item("lxc.uts.name") == optarg["n"]) + container:set_config_item("lxc.uts.name", "foobar") + assert(container:get_config_item("lxc.uts.name") == "foobar") + container:set_config_item("lxc.uts.name", optarg["n"]) + assert(container:get_config_item("lxc.uts.name") == optarg["n"]) -- test clearing/setting a 'list type' item container:clear_config_item("lxc.cap.drop") diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 23446939e..3c0b3b1d0 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -92,7 +92,7 @@ lxc_config_define(rootfs_mount); lxc_config_define(rootfs_options); lxc_config_define(rootfs_backend); lxc_config_define(rootfs); -lxc_config_define(utsname); +lxc_config_define(uts_name); lxc_config_define(hooks); lxc_config_define(net_type); lxc_config_define(net_flags); @@ -164,7 +164,13 @@ static struct lxc_config_t config[] = { { "lxc.rootfs.options", set_config_rootfs_options, get_config_rootfs_options, clr_config_rootfs_options, }, { "lxc.rootfs.backend", set_config_rootfs_backend, get_config_rootfs_backend, clr_config_rootfs_backend, }, { "lxc.rootfs", set_config_rootfs, get_config_rootfs, clr_config_rootfs, }, - { "lxc.utsname", set_config_utsname, get_config_utsname, clr_config_utsname, }, + + /* REMOVE IN LXC 3.0 + legacy utsname key + */ + { "lxc.utsname", set_config_uts_name, get_config_uts_name, clr_config_uts_name, }, + + { "lxc.uts.name", set_config_uts_name, get_config_uts_name, clr_config_uts_name, }, { "lxc.hook.pre-start", set_config_hooks, get_config_hooks, clr_config_hooks, }, { "lxc.hook.pre-mount", set_config_hooks, get_config_hooks, clr_config_hooks, }, { "lxc.hook.mount", set_config_hooks, get_config_hooks, clr_config_hooks, }, @@ -2059,13 +2065,13 @@ static int set_config_rootfs_backend(const char *key, const char *value, return set_config_string_item(&lxc_conf->rootfs.bdev_type, value); } -static int set_config_utsname(const char *key, const char *value, +static int set_config_uts_name(const char *key, const char *value, struct lxc_conf *lxc_conf, void *data) { struct utsname *utsname; if (lxc_config_value_empty(value)) { - clr_config_utsname(key, lxc_conf, NULL); + clr_config_uts_name(key, lxc_conf, NULL); return 0; } @@ -3050,7 +3056,7 @@ static int get_config_rootfs_backend(const char *key, char *retv, int inlen, return lxc_get_conf_str(retv, inlen, c->rootfs.bdev_type); } -static int get_config_utsname(const char *key, char *retv, int inlen, +static int get_config_uts_name(const char *key, char *retv, int inlen, struct lxc_conf *c, void *data) { return lxc_get_conf_str( @@ -3472,7 +3478,7 @@ static inline int clr_config_rootfs_backend(const char *key, struct lxc_conf *c, return 0; } -static inline int clr_config_utsname(const char *key, struct lxc_conf *c, +static inline int clr_config_uts_name(const char *key, struct lxc_conf *c, void *data) { free(c->utsname); diff --git a/src/lxc/lxccontainer.c b/src/lxc/lxccontainer.c index 5301d092c..ae0e708d2 100644 --- a/src/lxc/lxccontainer.c +++ b/src/lxc/lxccontainer.c @@ -3211,8 +3211,9 @@ static struct lxc_container *do_lxcapi_clone(struct lxc_container *c, const char // update utsname if (!(flags & LXC_CLONE_KEEPNAME)) { clear_unexp_config_line(c2->lxc_conf, "lxc.utsname", false); + clear_unexp_config_line(c2->lxc_conf, "lxc.uts.name", false); - if (!set_config_item_locked(c2, "lxc.utsname", newname)) { + if (!set_config_item_locked(c2, "lxc.uts.name", newname)) { ERROR("Error setting new hostname"); goto out; } diff --git a/src/python-lxc/examples/api_test.py b/src/python-lxc/examples/api_test.py index fac2bb06a..1934a238c 100755 --- a/src/python-lxc/examples/api_test.py +++ b/src/python-lxc/examples/api_test.py @@ -71,7 +71,7 @@ container.create("download", 0, assert(container.defined) assert(container.name == CONTAINER_NAME - == container.get_config_item("lxc.utsname")) + == container.get_config_item("lxc.uts.name")) assert(container.name in lxc.list_containers()) ## Test the config @@ -131,8 +131,8 @@ assert(len(ips) > 0) ## Test running config assert(container.name == CONTAINER_NAME - == container.get_config_item("lxc.utsname") - == container.get_running_config_item("lxc.utsname")) + == container.get_config_item("lxc.uts.name") + == container.get_running_config_item("lxc.uts.name")) ## Testing cgroups a bit print("Testing cgroup API") diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index 74334e100..e20272fe7 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -531,13 +531,22 @@ int main(int argc, char *argv[]) goto non_test_error; } - /* lxc.utsname */ + /* REMOVE IN LXC 3.0 + legacy lxc.utsname key + */ if (set_get_compare_clear_save_load(c, "lxc.utsname", "the-shire", tmpf, true) < 0) { lxc_error("%s\n", "lxc.utsname"); goto non_test_error; } + /* lxc.uts.name */ + if (set_get_compare_clear_save_load(c, "lxc.uts.name", "the-shire", tmpf, + true) < 0) { + lxc_error("%s\n", "lxc.uts.name"); + goto non_test_error; + } + /* lxc.hook.pre-start */ if (set_get_compare_clear_save_load( c, "lxc.hook.pre-start", "/some/pre-start", tmpf, false) < 0) { diff --git a/src/tests/startone.c b/src/tests/startone.c index 6b7344f66..f87519703 100644 --- a/src/tests/startone.c +++ b/src/tests/startone.c @@ -154,8 +154,8 @@ int main(int argc, char *argv[]) goto out; } - if (!c->set_config_item(c, "lxc.utsname", "bobo")) { - fprintf(stderr, "%d: failed setting lxc.utsname\n", __LINE__); + if (!c->set_config_item(c, "lxc.uts.name", "bobo")) { + fprintf(stderr, "%d: failed setting lxc.uts.name\n", __LINE__); goto out; } diff --git a/templates/lxc-alpine.in b/templates/lxc-alpine.in index 9a9200f7f..2d6a1b9ff 100644 --- a/templates/lxc-alpine.in +++ b/templates/lxc-alpine.in @@ -388,7 +388,7 @@ configure_container() { lxc.arch = $arch # Set hostname. - lxc.utsname = $hostname + lxc.uts.name = $hostname # If something doesn't work, try to comment this out. # Dropping sys_admin disables container root from doing a lot of things diff --git a/templates/lxc-altlinux.in b/templates/lxc-altlinux.in index b58bbc9da..082330c58 100644 --- a/templates/lxc-altlinux.in +++ b/templates/lxc-altlinux.in @@ -267,7 +267,7 @@ copy_configuration() mkdir -p $config_path grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "lxc.rootfs = $rootfs_path" >> $config_path/config cat <> $config_path/config -lxc.utsname = $name +lxc.uts.name = $name lxc.tty = 4 lxc.pts = 1024 lxc.cap.drop = sys_module mac_admin mac_override sys_time diff --git a/templates/lxc-archlinux.in b/templates/lxc-archlinux.in index 581ebb37d..46c422083 100644 --- a/templates/lxc-archlinux.in +++ b/templates/lxc-archlinux.in @@ -148,7 +148,7 @@ EOF copy_configuration() { mkdir -p "${config_path}" local config="${config_path}/config" - echo "lxc.utsname = ${name}" >> "${config}" + echo "lxc.uts.name = ${name}" >> "${config}" grep -q "^lxc.arch" "${config}" 2>/dev/null \ || echo "lxc.arch = ${arch}" >> "${config}" grep -q "^lxc.rootfs" "${config}" 2>/dev/null \ diff --git a/templates/lxc-busybox.in b/templates/lxc-busybox.in index 7e11ac3e5..ac0fcd43d 100644 --- a/templates/lxc-busybox.in +++ b/templates/lxc-busybox.in @@ -343,7 +343,7 @@ grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> cat <> $path/config lxc.signal.halt = SIGUSR1 lxc.rebootsignal = SIGTERM -lxc.utsname = $name +lxc.uts.name = $name lxc.tty = 1 lxc.pts = 1 lxc.cap.drop = sys_module mac_admin mac_override sys_time diff --git a/templates/lxc-centos.in b/templates/lxc-centos.in index a211636dc..23bc739fb 100644 --- a/templates/lxc-centos.in +++ b/templates/lxc-centos.in @@ -641,7 +641,7 @@ lxc.include = @LXCTEMPLATECONFIG@/centos.common.conf # Append things which require expansion here... cat <> $config_path/config lxc.arch = $arch -lxc.utsname = $utsname +lxc.uts.name = $utsname # When using LXC with apparmor, uncomment the next line to run unconfined: #lxc.aa_profile = unconfined diff --git a/templates/lxc-cirros.in b/templates/lxc-cirros.in index 1bfedda50..b9c94d91d 100644 --- a/templates/lxc-cirros.in +++ b/templates/lxc-cirros.in @@ -123,7 +123,7 @@ lxc.rootfs = $rootfs lxc.tty = 4 lxc.pts = 1024 -lxc.utsname = $name +lxc.uts.name = $name lxc.arch = $arch lxc.cap.drop = sys_module mac_admin mac_override sys_time diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index 8464ef9fd..bd9f9f9d6 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -515,7 +515,7 @@ copy_configuration() cat <> $path/config lxc.tty = $num_tty -lxc.utsname = $hostname +lxc.uts.name = $hostname lxc.arch = $arch lxc.pts=1023 EOF diff --git a/templates/lxc-download.in b/templates/lxc-download.in index 49a9c826e..fb891b039 100644 --- a/templates/lxc-download.in +++ b/templates/lxc-download.in @@ -547,7 +547,7 @@ fi if [ -e "$fstab" ]; then echo "lxc.mount = ${LXC_PATH}/fstab" >> ${LXC_PATH}/config fi -echo "lxc.utsname = ${LXC_NAME}" >> ${LXC_PATH}/config +echo "lxc.uts.name = ${LXC_NAME}" >> ${LXC_PATH}/config ## Re-add the previously removed network config if [ -e "${LXC_PATH}/config-network" ]; then diff --git a/templates/lxc-fedora-legacy.in b/templates/lxc-fedora-legacy.in index 2c5abd13e..815f74c53 100644 --- a/templates/lxc-fedora-legacy.in +++ b/templates/lxc-fedora-legacy.in @@ -1127,7 +1127,7 @@ lxc.include = @LXCTEMPLATECONFIG@/fedora.common.conf # Append things which require expansion here... cat <> $config_path/config lxc.arch = $arch -lxc.utsname = $utsname +lxc.uts.name = $utsname # When using LXC with apparmor, uncomment the next line to run unconfined: #lxc.aa_profile = unconfined diff --git a/templates/lxc-fedora.in b/templates/lxc-fedora.in index 0cd790de9..46a9b918c 100644 --- a/templates/lxc-fedora.in +++ b/templates/lxc-fedora.in @@ -486,7 +486,7 @@ lxc.include = ${lxc_template_config}/fedora.common.conf cat <> "${path}/config" # Container specific configuration lxc.arch = ${basearch} -lxc.utsname = ${utsname} +lxc.uts.name = ${utsname} # When using LXC with apparmor, uncomment the next line to run unconfined: #lxc.aa_profile = unconfined diff --git a/templates/lxc-gentoo.in b/templates/lxc-gentoo.in index e918d9902..8f68f1757 100644 --- a/templates/lxc-gentoo.in +++ b/templates/lxc-gentoo.in @@ -705,7 +705,7 @@ container_conf() ${conf_arch_line} # set the hostname -lxc.utsname = ${name} +lxc.uts.name = ${name} lxc.tty = ${tty} ${conf_rootfs_line} diff --git a/templates/lxc-openmandriva.in b/templates/lxc-openmandriva.in index 6a4df8ff4..fbc7c7866 100644 --- a/templates/lxc-openmandriva.in +++ b/templates/lxc-openmandriva.in @@ -228,7 +228,7 @@ copy_configuration() mkdir -p $config_path grep -q "^lxc.rootfs" $config_path/config 2>/dev/null || echo "lxc.rootfs = $rootfs_path" >> $config_path/config cat <> $config_path/config -lxc.utsname = $name +lxc.uts.name = $name lxc.tty = 4 lxc.pts = 1024 lxc.cap.drop = sys_module mac_admin mac_override sys_time diff --git a/templates/lxc-opensuse.in b/templates/lxc-opensuse.in index 6ba5a83d1..380b3c028 100644 --- a/templates/lxc-opensuse.in +++ b/templates/lxc-opensuse.in @@ -350,7 +350,7 @@ lxc.include = @LXCTEMPLATECONFIG@/opensuse.common.conf # Append things which require expansion here... cat <> $path/config lxc.arch = $arch -lxc.utsname = $name +lxc.uts.name = $name lxc.mount.auto = cgroup:mixed proc:mixed sys:mixed diff --git a/templates/lxc-oracle.in b/templates/lxc-oracle.in index f06b70ec3..eeb7e7448 100644 --- a/templates/lxc-oracle.in +++ b/templates/lxc-oracle.in @@ -482,7 +482,7 @@ container_config_create() cat <> $cfg_dir/config || die "unable to create $cfg_dir/config" # Container configuration for Oracle Linux $container_release_major.$container_release_minor lxc.arch = $arch -lxc.utsname = $name +lxc.uts.name = $name EOF grep -q "^lxc.rootfs" $cfg_dir/config 2>/dev/null || echo "lxc.rootfs = $container_rootfs" >> $cfg_dir/config diff --git a/templates/lxc-plamo.in b/templates/lxc-plamo.in index c96e23e11..9c17f77be 100644 --- a/templates/lxc-plamo.in +++ b/templates/lxc-plamo.in @@ -233,7 +233,7 @@ configure_plamo() { copy_configuration() { ret=0 cat <<- EOF >> $path/config || let ret++ - lxc.utsname = $name + lxc.uts.name = $name lxc.arch = $arch EOF if [ -f "@LXCTEMPLATECONFIG@/plamo.common.conf" ] ; then diff --git a/templates/lxc-pld.in b/templates/lxc-pld.in index a8e534646..60c75ca00 100644 --- a/templates/lxc-pld.in +++ b/templates/lxc-pld.in @@ -238,7 +238,7 @@ copy_configuration() cat <> $config_path/config # Most of below settings should be taken as defaults from # lxc.include = /usr/share/lxc/config/common.conf -lxc.utsname = $utsname +lxc.uts.name = $utsname lxc.tty = 4 lxc.pts = 1024 # Consider if below line is right for systemd container diff --git a/templates/lxc-sabayon.in b/templates/lxc-sabayon.in index 7a2f09e67..76e877d47 100644 --- a/templates/lxc-sabayon.in +++ b/templates/lxc-sabayon.in @@ -324,7 +324,7 @@ lxc.cgroup.devices.allow = c 10:229 rwm lxc.arch = $arch # Set hostname. -lxc.utsname = $hostname +lxc.uts.name = $hostname # Include common configuration. lxc.include = $LXC_TEMPLATE_CONFIG/sabayon.common.conf diff --git a/templates/lxc-slackware.in b/templates/lxc-slackware.in index 216c7a724..f36e150a7 100644 --- a/templates/lxc-slackware.in +++ b/templates/lxc-slackware.in @@ -638,7 +638,7 @@ name=$3 cat <> $path/config -lxc.utsname = $name +lxc.uts.name = $name lxc.arch = $arch lxc.mount = $rootfs/etc/fstab diff --git a/templates/lxc-sparclinux.in b/templates/lxc-sparclinux.in index 1757706f1..087c54552 100644 --- a/templates/lxc-sparclinux.in +++ b/templates/lxc-sparclinux.in @@ -316,7 +316,7 @@ container_config_create() cat <> $cfg_dir/config || die "unable to create $cfg_dir/config" # Container configuration for Linux for SPARC $container_release_major.$container_release_minor lxc.arch = $arch -lxc.utsname = $name +lxc.uts.name = $name EOF grep -q "^lxc.rootfs" $cfg_dir/config 2>/dev/null || echo "lxc.rootfs = $container_rootfs" >> $cfg_dir/config diff --git a/templates/lxc-sshd.in b/templates/lxc-sshd.in index 0093efee9..08b303de9 100644 --- a/templates/lxc-sshd.in +++ b/templates/lxc-sshd.in @@ -129,7 +129,7 @@ copy_configuration() grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config cat <> $path/config -lxc.utsname = $name +lxc.uts.name = $name lxc.pts = 1024 lxc.cap.drop = sys_module mac_admin mac_override sys_time diff --git a/templates/lxc-ubuntu-cloud.in b/templates/lxc-ubuntu-cloud.in index 80a06c817..9717fa874 100644 --- a/templates/lxc-ubuntu-cloud.in +++ b/templates/lxc-ubuntu-cloud.in @@ -91,7 +91,7 @@ copy_configuration() [ -e "$path/config-auto" ] && cat $path/config-auto >> $path/config && rm $path/config-auto grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config cat <> $path/config -lxc.utsname = $name +lxc.uts.name = $name lxc.arch = $arch EOF diff --git a/templates/lxc-ubuntu.in b/templates/lxc-ubuntu.in index a897150a2..81d6b6ca2 100644 --- a/templates/lxc-ubuntu.in +++ b/templates/lxc-ubuntu.in @@ -531,7 +531,7 @@ copy_configuration() [ -e "$path/config-auto" ] && cat $path/config-auto >> $path/config && rm $path/config-auto grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config cat <> $path/config -lxc.utsname = $name +lxc.uts.name = $name lxc.arch = $arch EOF diff --git a/templates/lxc-voidlinux.in b/templates/lxc-voidlinux.in index 380d8a113..6a4e91923 100644 --- a/templates/lxc-voidlinux.in +++ b/templates/lxc-voidlinux.in @@ -68,7 +68,7 @@ declare -a additional_packages copy_configuration() { mkdir -p "${config_path}" local config="${config_path}/config" - echo "lxc.utsname = ${name}" >> "${config}" + echo "lxc.uts.name = ${name}" >> "${config}" grep -q "^lxc.rootfs" "${config}" 2>/dev/null \ || echo "lxc.rootfs = ${rootfs_path}" >> "${config}" -- 2.39.5