From: 0x0916 Date: Wed, 28 Jun 2017 08:32:04 +0000 (+0800) Subject: confile: namespace lxc.init keys X-Git-Tag: lxc-2.1.1~141^2~4 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=9dcf7b4d23c1014dc85c649786a58f128d3e3a1b;hp=240d4b74ced3fb9503fa181a3d0ef22fe8847d47;p=mirror_lxc.git confile: namespace lxc.init keys * rename lxc.init_cmd to lxc.init.cmd * rename lxc.init_uid to lxc.init.uid * rename lxc.init_gid to lxc.init.gid the legacy keys will be kept around until LXC 3.0 and then will be removed. Signed-off-by: 0x0916 --- diff --git a/doc/ja/lxc-start.sgml.in b/doc/ja/lxc-start.sgml.in index c0dd8723f..b87833d10 100644 --- a/doc/ja/lxc-start.sgml.in +++ b/doc/ja/lxc-start.sgml.in @@ -94,12 +94,12 @@ by KATOH Yasufumi - もし command が指定されない場合は、lxc-start はシステムコンテナを実行するためのコマンドとして、lxc.init_cmd で設定されたコマンドを使用します。 - もし lxc.init_cmd が設定されていない場合は、デフォルトで "/sbin/init" を使用します。 + もし command が指定されない場合は、lxc-start はシステムコンテナを実行するためのコマンドとして、lxc.init.cmd で設定されたコマンドを使用します。 + もし lxc.init.cmd が設定されていない場合は、デフォルトで "/sbin/init" を使用します。 diff --git a/doc/ja/lxc.container.conf.sgml.in b/doc/ja/lxc.container.conf.sgml.in index aa363512b..8ac4189e5 100644 --- a/doc/ja/lxc.container.conf.sgml.in +++ b/doc/ja/lxc.container.conf.sgml.in @@ -349,7 +349,7 @@ by KATOH Yasufumi - + @@ -381,7 +381,7 @@ by KATOH Yasufumi - + @@ -394,7 +394,7 @@ by KATOH Yasufumi - + diff --git a/doc/ja/lxc.sgml.in b/doc/ja/lxc.sgml.in index e41c1a782..8f5d17238 100644 --- a/doc/ja/lxc.sgml.in +++ b/doc/ja/lxc.sgml.in @@ -556,12 +556,12 @@ rootfs command into the container. The pid of the first process is 1. If no command is specified lxc-start will - run the command defined in lxc.init_cmd or if not set, + run the command defined in lxc.init.cmd or if not set, /sbin/init . --> lxc-start コマンドは、コンテナ内の特定のコマンドを直接実行します。 最初のプロセスの pid が 1 となります。 - もし、実行するコマンドが指定されない場合は、lxc-start は lxc.init_cmd で設定されたコマンドを実行します。もし lxc.init_cmd が設定されていない場合は /sbin/init を実行します。 + もし、実行するコマンドが指定されない場合は、lxc-start は lxc.init.cmd で設定されたコマンドを実行します。もし lxc.init.cmd が設定されていない場合は /sbin/init を実行します。 diff --git a/doc/ko/lxc-start.sgml.in b/doc/ko/lxc-start.sgml.in index a507747f3..5001995a8 100644 --- a/doc/ko/lxc-start.sgml.in +++ b/doc/ko/lxc-start.sgml.in @@ -95,11 +95,11 @@ by Sungbae Yoo - 만약 명령어가 지정되지 않았다면, lxc-start는 lxc.init_cmd에 정의된 명령어를 사용한다. 만약 그마저도 없다면 "/sbin/init"명령어를 사용한다. + 만약 명령어가 지정되지 않았다면, lxc-start는 lxc.init.cmd에 정의된 명령어를 사용한다. 만약 그마저도 없다면 "/sbin/init"명령어를 사용한다. diff --git a/doc/ko/lxc.container.conf.sgml.in b/doc/ko/lxc.container.conf.sgml.in index af07f8cc7..9dba8a96a 100644 --- a/doc/ko/lxc.container.conf.sgml.in +++ b/doc/ko/lxc.container.conf.sgml.in @@ -308,7 +308,7 @@ by Sungbae Yoo - + @@ -343,7 +343,7 @@ by Sungbae Yoo - + @@ -356,7 +356,7 @@ by Sungbae Yoo - + diff --git a/doc/ko/lxc.sgml.in b/doc/ko/lxc.sgml.in index 45e4ed6d8..1b9f979f2 100644 --- a/doc/ko/lxc.sgml.in +++ b/doc/ko/lxc.sgml.in @@ -542,10 +542,10 @@ rootfs command into the container. The pid of the first process is 1. If no command is specified lxc-start will - run the command defined in lxc.init_cmd or if not set, + run the command defined in lxc.init.cmd or if not set, /sbin/init . --> - lxc-start 명령어는 지정한 명령어를 컨테이너 내에서 직접 실행한다. 첫 프로세스의 pid는 1번이다. 만약 어떤 명령어도 지정되지 않으면, lxc.init_cmd에 지정된 명령어를 실행한다. 이마저도 지정되있지 않으면, /sbin/init를 실행한다. + lxc-start 명령어는 지정한 명령어를 컨테이너 내에서 직접 실행한다. 첫 프로세스의 pid는 1번이다. 만약 어떤 명령어도 지정되지 않으면, lxc.init.cmd에 지정된 명령어를 실행한다. 이마저도 지정되있지 않으면, /sbin/init를 실행한다. diff --git a/doc/lxc-start.sgml.in b/doc/lxc-start.sgml.in index 1770ac2ce..1f6fbb741 100644 --- a/doc/lxc-start.sgml.in +++ b/doc/lxc-start.sgml.in @@ -80,7 +80,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA If no command is specified, lxc-start will - use the command defined in lxc.init_cmd or if not set, the default + use the command defined in lxc.init.cmd or if not set, the default "/sbin/init" command to run a system container. diff --git a/doc/lxc.container.conf.sgml.in b/doc/lxc.container.conf.sgml.in index d4581587a..cf47e1224 100644 --- a/doc/lxc.container.conf.sgml.in +++ b/doc/lxc.container.conf.sgml.in @@ -263,7 +263,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + @@ -287,7 +287,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + @@ -297,7 +297,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - + diff --git a/doc/lxc.sgml.in b/doc/lxc.sgml.in index 1b98b47e1..a068d2c12 100644 --- a/doc/lxc.sgml.in +++ b/doc/lxc.sgml.in @@ -376,7 +376,7 @@ rootfs command into the container. The pid of the first process is 1. If no command is specified lxc-start will - run the command defined in lxc.init_cmd or if not set, + run the command defined in lxc.init.cmd or if not set, /sbin/init . diff --git a/src/lxc/confile.c b/src/lxc/confile.c index 58a98e541..df2a5056a 100644 --- a/src/lxc/confile.c +++ b/src/lxc/confile.c @@ -226,18 +226,20 @@ static struct lxc_config_t config[] = { { "lxc.monitor.unshare", set_config_monitor, get_config_monitor, clr_config_monitor, }, { "lxc.group", set_config_group, get_config_group, clr_config_group, }, { "lxc.environment", set_config_environment, get_config_environment, clr_config_environment, }, - { "lxc.init_cmd", set_config_init_cmd, get_config_init_cmd, clr_config_init_cmd, }, - { "lxc.init_uid", set_config_init_uid, get_config_init_uid, clr_config_init_uid, }, - { "lxc.init_gid", set_config_init_gid, get_config_init_gid, clr_config_init_gid, }, { "lxc.ephemeral", set_config_ephemeral, get_config_ephemeral, clr_config_ephemeral, }, { "lxc.syslog", set_config_syslog, get_config_syslog, clr_config_syslog, }, { "lxc.no_new_privs", set_config_no_new_privs, get_config_no_new_privs, clr_config_no_new_privs, }, - /* REMOVE IN LXC 3.0 - legacy keys - */ + /* REMOVE IN LXC 3.0: legacy keys [START]*/ + { "lxc.init_cmd", set_config_init_cmd, get_config_init_cmd, clr_config_init_cmd, }, + { "lxc.init_uid", set_config_init_uid, get_config_init_uid, clr_config_init_uid, }, + { "lxc.init_gid", set_config_init_gid, get_config_init_gid, clr_config_init_gid, }, { "lxc.limit", set_config_limit, get_config_limit, clr_config_limit, }, + /* REMOVE IN LXC 3.0: legacy keys [END]*/ + { "lxc.init.cmd", set_config_init_cmd, get_config_init_cmd, clr_config_init_cmd, }, + { "lxc.init.uid", set_config_init_uid, get_config_init_uid, clr_config_init_uid, }, + { "lxc.init.gid", set_config_init_gid, get_config_init_gid, clr_config_init_gid, }, { "lxc.prlimit", set_config_prlimit, get_config_prlimit, clr_config_prlimit, }, }; diff --git a/src/tests/parse_config_file.c b/src/tests/parse_config_file.c index 3cf5a67ca..815553f78 100644 --- a/src/tests/parse_config_file.c +++ b/src/tests/parse_config_file.c @@ -694,27 +694,54 @@ int main(int argc, char *argv[]) goto non_test_error; } - /* lxc.init_cmd */ + /* REMOVE IN LXC 3.0 + legacy lxc.init_cmd key + */ if (set_get_compare_clear_save_load(c, "lxc.init_cmd", "/bin/bash", tmpf, true) < 0) { lxc_error("%s\n", "lxc.init_cmd"); goto non_test_error; } - /* lxc.init_uid */ + /* lxc.init.cmd */ + if (set_get_compare_clear_save_load(c, "lxc.init.cmd", "/bin/bash", + tmpf, true) < 0) { + lxc_error("%s\n", "lxc.init.cmd"); + goto non_test_error; + } + + /* REMOVE IN LXC 3.0 + legacy lxc.init_uid key + */ if (set_get_compare_clear_save_load(c, "lxc.init_uid", "1000", tmpf, true) < 0) { lxc_error("%s\n", "lxc.init_uid"); goto non_test_error; } - /* lxc.init_gid */ + /* lxc.init.uid */ + if (set_get_compare_clear_save_load(c, "lxc.init.uid", "1000", tmpf, + true) < 0) { + lxc_error("%s\n", "lxc.init.uid"); + goto non_test_error; + } + + /* REMOVE IN LXC 3.0 + legacy lxc.init_gid key + */ if (set_get_compare_clear_save_load(c, "lxc.init_gid", "1000", tmpf, true) < 0) { lxc_error("%s\n", "lxc.init_gid"); goto non_test_error; } + /* lxc.init.gid */ + if (set_get_compare_clear_save_load(c, "lxc.init.gid", "1000", tmpf, + true) < 0) { + lxc_error("%s\n", "lxc.init.gid"); + goto non_test_error; + } + /* lxc.ephemeral */ if (set_get_compare_clear_save_load(c, "lxc.ephemeral", "1", tmpf, true) < 0) {