]> git.proxmox.com Git - mirror_lxc.git/commitdiff
confile: namespace lxc.signal keys
author0x0916 <w@laoqinren.net>
Wed, 28 Jun 2017 11:26:02 +0000 (19:26 +0800)
committer0x0916 <w@laoqinren.net>
Fri, 30 Jun 2017 01:41:25 +0000 (09:41 +0800)
* rename lxc.haltsignal to lxc.signal.halt
* rename lxc.rebootsignal to lxc.signal.reboot
* rename lxc.stopsignal to lxc.signal.stop

the legacy keys will be kept around until LXC 3.0 and then will be
removed.

Signed-off-by: 0x0916 <w@laoqinren.net>
12 files changed:
config/templates/archlinux.common.conf.in
config/templates/voidlinux.common.conf.in
config/templates/voidlinux.userns.conf.in
doc/ja/lxc-stop.sgml.in
doc/ja/lxc.container.conf.sgml.in
doc/ko/lxc-stop.sgml.in
doc/ko/lxc.container.conf.sgml.in
doc/lxc-stop.sgml.in
doc/lxc.container.conf.sgml.in
src/lxc/confile.c
src/tests/parse_config_file.c
templates/lxc-busybox.in

index f86949138e7893590ca3363be5a57a13b22c01b5..043b27cc5ed1af0f9b461759076d471f8f739d99 100644 (file)
@@ -5,8 +5,8 @@ lxc.include = @LXCTEMPLATECONFIG@/common.conf
 lxc.tty = 6
 
 # Set the halt/stop signals
-lxc.haltsignal=SIGRTMIN+4
-lxc.stopsignal=SIGRTMIN+14
+lxc.signal.halt=SIGRTMIN+4
+lxc.signal.stop=SIGRTMIN+14
 
 # Uncomment to disable creating tty devices subdirectory in /dev
 # lxc.devttydir =
index d5d2ee81c8934fc4ed306ed46bb94ba483dcd801..41ab1a2fe8e7e23a637f3bd507f5f92a687485aa 100644 (file)
@@ -8,7 +8,7 @@ lxc.tty = 6
 lxc.environment=VIRTUALIZATION=lxc
 
 # Set the halt/stop signals
-lxc.haltsignal=SIGCONT
+lxc.signal.halt=SIGCONT
 
 
 # Uncomment to disable creating tty devices subdirectory in /dev
index 5e346b7c505f3727cda8ef3a36b22b1e882bb8b6..f319bc5469fb93199486f32c9843824f12281deb 100644 (file)
@@ -5,4 +5,4 @@ lxc.include = @LXCTEMPLATECONFIG@/userns.conf
 lxc.environment=VIRTUALIZATION=lxc
 
 # Set the halt/stop signals
-lxc.haltsignal=SIGCONT
+lxc.signal.halt=SIGCONT
index 79f7a9a3ea7b98af8898829d655ecab94b55d97d..1648851bd35608169c37c7bd677035c6350687d2 100644 (file)
@@ -73,18 +73,18 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
       <command>lxc-stop</command> reboots, cleanly shuts down, or kills
       all the processes inside the container.  By default, it will
       request a clean shutdown of the container by sending
-      <command>lxc.haltsignal</command> (defaults to SIGPWR) to
+      <command>lxc.signal.halt</command> (defaults to SIGPWR) to
       the container's init process, waiting up to 60 seconds for the container
       to exit, and then returning. If the container fails to cleanly exit in
-      60 seconds, it will be sent the <command>lxc.stopsignal</command>
+      60 seconds, it will be sent the <command>lxc.signal.stop</command>
       (defaults to SIGKILL) to force it to shut down. A request to reboot will
-      send the <command>lxc.rebootsignal</command> (defaults to SIGINT) to the
+      send the <command>lxc.signal.reboot</command> (defaults to SIGINT) to the
       container's init process.
       -->
       <command>lxc-stop</command> は、リブート、クリーンシャットダウン、コンテナ内の全てのプロセスの kill のどれかを行います。
-      デフォルトでは、コンテナのクリーンなシャットダウンを <command>lxc.haltsignal</command> (デフォルトでは SIGPWR) をコンテナの init プロセスに送ることでリクエストし、コンテナの終了を 60 秒待ち、return します。
-      コンテナが 60 秒の間にクリーンに終了するのに失敗した場合、<command>lxc.stopsignal</command> (デフォルトは SIGKILL です) を送り、強制的にシャットダウンします。
-      リブートのリクエストは <command>lxc.rebootsignal</command> に設定されたシグナルをコンテナの init プロセスに送ります (デフォルトは SIGINT です)。
+      デフォルトでは、コンテナのクリーンなシャットダウンを <command>lxc.signal.halt</command> (デフォルトでは SIGPWR) をコンテナの init プロセスに送ることでリクエストし、コンテナの終了を 60 秒待ち、return します。
+      コンテナが 60 秒の間にクリーンに終了するのに失敗した場合、<command>lxc.signal.stop</command> (デフォルトは SIGKILL です) を送り、強制的にシャットダウンします。
+      リブートのリクエストは <command>lxc.signal.reboot</command> に設定されたシグナルをコンテナの init プロセスに送ります (デフォルトは SIGINT です)。
     </para>
 
     <para>
index 2835b0507e2840660eebfd62c43cdcb093dbf3d8..e941fcec7fa80266397bd43e1e02d235bf025488 100644 (file)
@@ -260,7 +260,7 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.haltsignal</option>
+            <option>lxc.signal.halt</option>
           </term>
           <listitem>
             <para>
@@ -289,7 +289,7 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
           <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.rebootsignal</option>
+            <option>lxc.signal.reboot</option>
           </term>
           <listitem>
             <para>
@@ -318,7 +318,7 @@ by KATOH Yasufumi <karma at jazz.email.ne.jp>
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.stopsignal</option>
+            <option>lxc.signal.stop</option>
           </term>
           <listitem>
             <para>
index e50f029d82c275d96f86a210c6a6da41c1414441..af14d8436e6910c4b4e504bc3fb86d6939834ca7 100644 (file)
@@ -73,16 +73,16 @@ by Sungbae Yoo <sungbae.yoo at samsung.com>
       <command>lxc-stop</command> reboots, cleanly shuts down, or kills
       all the processes inside the container.  By default, it will
       request a clean shutdown of the container by sending
-      <command>lxc.haltsignal</command> (defaults to SIGPWR) to
+      <command>lxc.signal.halt</command> (defaults to SIGPWR) to
       the container's init process, waiting up to 60 seconds for the container
       to exit, and then returning. If the container fails to cleanly exit in
-      60 seconds, it will be sent the <command>lxc.stopsignal</command>
+      60 seconds, it will be sent the <command>lxc.signal.stop</command>
       (defaults to SIGKILL) to force it to shut down. A request to reboot will
-      send the <command>lxc.rebootsignal</command> (defaults to SIGINT) to the
+      send the <command>lxc.signal.reboot</command> (defaults to SIGINT) to the
       container's init process.
       -->
-      <command>lxc-stop</command> 는 재뷰탕, 종료, 또는 컨테이너 내의 모든 프로세스를 강제종료 시킨다. 기본 동작은 컨테이너에게 <command>lxc.haltsignal</command> 시그널(기본값은 SIGPWR)을 컨테이너 init 프로세스에게 날려, 컨테이너가 종료되게 요청하는 것이다. 60초 동안 컨테이너가 종료되는 것을 기다리고 리턴된다.
-만약 컨테이너가 60초안에 종료되지 않는다면 <command>lxc.stopsignal</command> 시그널(기본값은 SIGKILL)을 날려 강제로 종료시킨다. 재부팅 요청시에는 <command>lxc.rebootsignal</command> 시그널(기본값은 SIGINT)를 컨테이너 init 프로세스에게 날린다.
+      <command>lxc-stop</command> 는 재뷰탕, 종료, 또는 컨테이너 내의 모든 프로세스를 강제종료 시킨다. 기본 동작은 컨테이너에게 <command>lxc.signal.halt</command> 시그널(기본값은 SIGPWR)을 컨테이너 init 프로세스에게 날려, 컨테이너가 종료되게 요청하는 것이다. 60초 동안 컨테이너가 종료되는 것을 기다리고 리턴된다.
+만약 컨테이너가 60초안에 종료되지 않는다면 <command>lxc.signal.stop</command> 시그널(기본값은 SIGKILL)을 날려 강제로 종료시킨다. 재부팅 요청시에는 <command>lxc.signal.reboot</command> 시그널(기본값은 SIGINT)를 컨테이너 init 프로세스에게 날린다.
     </para>
 
     <para>
index 1bbf8f440d590b15ab1483a45a6cef3c153b20cc..738748b521cbcb9e6811e825ea22487ed720fa49 100644 (file)
@@ -219,7 +219,7 @@ by Sungbae Yoo <sungbae.yoo at samsung.com>
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.haltsignal</option>
+            <option>lxc.signal.halt</option>
           </term>
           <listitem>
             <para>
@@ -248,7 +248,7 @@ by Sungbae Yoo <sungbae.yoo at samsung.com>
           <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.rebootsignal</option>
+            <option>lxc.signal.reboot</option>
           </term>
           <listitem>
             <para>
@@ -277,7 +277,7 @@ by Sungbae Yoo <sungbae.yoo at samsung.com>
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.stopsignal</option>
+            <option>lxc.signal.stop</option>
           </term>
           <listitem>
             <para>
index 3c69feda5782d65eaece9edf395656d586818bdd..09db5f6215ee461ad40a5f1fbcaa1228e5c5ce4c 100644 (file)
@@ -66,12 +66,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       <command>lxc-stop</command> reboots, cleanly shuts down, or kills
       all the processes inside the container.  By default, it will
       request a clean shutdown of the container by sending
-      <command>lxc.haltsignal</command> (defaults to SIGPWR) to
+      <command>lxc.signal.halt</command> (defaults to SIGPWR) to
       the container's init process, waiting up to 60 seconds for the container
       to exit, and then returning. If the container fails to cleanly exit in
-      60 seconds, it will be sent the <command>lxc.stopsignal</command>
+      60 seconds, it will be sent the <command>lxc.signal.stop</command>
       (defaults to SIGKILL) to force it to shut down. A request to reboot will
-      send the <command>lxc.rebootsignal</command> (defaults to SIGINT) to the
+      send the <command>lxc.signal.reboot</command> (defaults to SIGINT) to the
       container's init process.
     </para>
        <para>
index 0ef45c494b3c228b86fc0c8fa7ef966bb7c35c84..3b639dd7f5b69d5b206b07a83960f42c6953d37c 100644 (file)
@@ -196,7 +196,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
       <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.haltsignal</option>
+            <option>lxc.signal.halt</option>
           </term>
           <listitem>
             <para>
@@ -218,7 +218,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
           <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.rebootsignal</option>
+            <option>lxc.signal.reboot</option>
           </term>
           <listitem>
             <para>
@@ -240,7 +240,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
           <variablelist>
         <varlistentry>
           <term>
-            <option>lxc.stopsignal</option>
+            <option>lxc.signal.stop</option>
           </term>
           <listitem>
             <para>
index 1af6f5f661ebe854489d07b6999e05ba85bae80a..d9fa41269a9c1a1cbfbe1065d30b813fd4254a93 100644 (file)
@@ -118,9 +118,9 @@ lxc_config_define(console);
 lxc_config_define(seccomp);
 lxc_config_define(includefiles);
 lxc_config_define(autodev);
-lxc_config_define(haltsignal);
-lxc_config_define(rebootsignal);
-lxc_config_define(stopsignal);
+lxc_config_define(signal_halt);
+lxc_config_define(signal_reboot);
+lxc_config_define(signal_stop);
 lxc_config_define(start);
 lxc_config_define(monitor);
 lxc_config_define(group);
@@ -215,9 +215,17 @@ static struct lxc_config_t config[] = {
        { "lxc.seccomp",                   set_config_seccomp,                     get_config_seccomp,                     clr_config_seccomp,                   },
        { "lxc.include",                   set_config_includefiles,                get_config_includefiles,                clr_config_includefiles,              },
        { "lxc.autodev",                   set_config_autodev,                     get_config_autodev,                     clr_config_autodev,                   },
-       { "lxc.haltsignal",                set_config_haltsignal,                  get_config_haltsignal,                  clr_config_haltsignal,                },
-       { "lxc.rebootsignal",              set_config_rebootsignal,                get_config_rebootsignal,                clr_config_rebootsignal,              },
-       { "lxc.stopsignal",                set_config_stopsignal,                  get_config_stopsignal,                  clr_config_stopsignal,                },
+
+       /* REMOVE IN LXC 3.0
+          legacy singal keys
+        */
+       { "lxc.haltsignal",                set_config_signal_halt,                 get_config_signal_halt,                 clr_config_signal_halt,               },
+       { "lxc.rebootsignal",              set_config_signal_reboot,               get_config_signal_reboot,               clr_config_signal_reboot,             },
+       { "lxc.stopsignal",                set_config_signal_stop,                 get_config_signal_stop,                 clr_config_signal_stop,               },
+
+       { "lxc.signal.halt",               set_config_signal_halt,                 get_config_signal_halt,                 clr_config_signal_halt,               },
+       { "lxc.signal.reboot",             set_config_signal_reboot,               get_config_signal_reboot,               clr_config_signal_reboot,             },
+       { "lxc.signal.stop",               set_config_signal_stop,                 get_config_signal_stop,                 clr_config_signal_stop,               },
        { "lxc.start.auto",                set_config_start,                       get_config_start,                       clr_config_start,                     },
        { "lxc.start.delay",               set_config_start,                       get_config_start,                       clr_config_start,                     },
        { "lxc.start.order",               set_config_start,                       get_config_start,                       clr_config_start,                     },
@@ -1446,7 +1454,7 @@ static int sig_parse(const char *signame)
        return -1;
 }
 
-static int set_config_haltsignal(const char *key, const char *value,
+static int set_config_signal_halt(const char *key, const char *value,
                                 struct lxc_conf *lxc_conf, void *data)
 {
        int sig_n;
@@ -1467,7 +1475,7 @@ static int set_config_haltsignal(const char *key, const char *value,
        return 0;
 }
 
-static int set_config_rebootsignal(const char *key, const char *value,
+static int set_config_signal_reboot(const char *key, const char *value,
                                   struct lxc_conf *lxc_conf, void *data)
 {
        int sig_n;
@@ -1487,7 +1495,7 @@ static int set_config_rebootsignal(const char *key, const char *value,
        return 0;
 }
 
-static int set_config_stopsignal(const char *key, const char *value,
+static int set_config_signal_stop(const char *key, const char *value,
                                 struct lxc_conf *lxc_conf, void *data)
 {
        int sig_n;
@@ -3159,19 +3167,19 @@ static int get_config_autodev(const char *key, char *retv, int inlen,
        return lxc_get_conf_int(c, retv, inlen, c->autodev);
 }
 
-static int get_config_haltsignal(const char *key, char *retv, int inlen,
+static int get_config_signal_halt(const char *key, char *retv, int inlen,
                                 struct lxc_conf *c, void *data)
 {
        return lxc_get_conf_int(c, retv, inlen, c->haltsignal);
 }
 
-static int get_config_rebootsignal(const char *key, char *retv, int inlen,
+static int get_config_signal_reboot(const char *key, char *retv, int inlen,
                                   struct lxc_conf *c, void *data)
 {
        return lxc_get_conf_int(c, retv, inlen, c->rebootsignal);
 }
 
-static int get_config_stopsignal(const char *key, char *retv, int inlen,
+static int get_config_signal_stop(const char *key, char *retv, int inlen,
                                 struct lxc_conf *c, void *data)
 {
        return lxc_get_conf_int(c, retv, inlen, c->stopsignal);
@@ -3523,21 +3531,21 @@ static inline int clr_config_autodev(const char *key, struct lxc_conf *c,
        return 0;
 }
 
-static inline int clr_config_haltsignal(const char *key, struct lxc_conf *c,
+static inline int clr_config_signal_halt(const char *key, struct lxc_conf *c,
                                        void *data)
 {
        c->haltsignal = 0;
        return 0;
 }
 
-static inline int clr_config_rebootsignal(const char *key, struct lxc_conf *c,
+static inline int clr_config_signal_reboot(const char *key, struct lxc_conf *c,
                                          void *data)
 {
        c->rebootsignal = 0;
        return 0;
 }
 
-static inline int clr_config_stopsignal(const char *key, struct lxc_conf *c,
+static inline int clr_config_signal_stop(const char *key, struct lxc_conf *c,
                                        void *data)
 {
        c->stopsignal = 0;
index b2988d64663c01d582fc599eb4f2e18113f40157..bab9c2ff29cbc41428db36c59159f6b396283017 100644 (file)
@@ -636,27 +636,54 @@ int main(int argc, char *argv[])
                goto non_test_error;
        }
 
-       /* lxc.haltsignal */
+       /* REMOVE IN LXC 3.0
+          legacy lxc.haltsignal key
+        */
        if (set_get_compare_clear_save_load(c, "lxc.haltsignal", "1", tmpf,
                                            true) < 0) {
                lxc_error("%s\n", "lxc.haltsignal");
                goto non_test_error;
        }
 
-       /* lxc.rebootsignal */
+       /* lxc.signal.halt */
+       if (set_get_compare_clear_save_load(c, "lxc.signal.halt", "1", tmpf,
+                                           true) < 0) {
+               lxc_error("%s\n", "lxc.signal.halt");
+               goto non_test_error;
+       }
+
+       /* REMOVE IN LXC 3.0
+          legacy lxc.rebootsignal key
+        */
        if (set_get_compare_clear_save_load(c, "lxc.rebootsignal", "1", tmpf,
                                            true) < 0) {
                lxc_error("%s\n", "lxc.rebootsignal");
                goto non_test_error;
        }
 
-       /* lxc.stopsignal */
+       /* lxc.signal.reboot */
+       if (set_get_compare_clear_save_load(c, "lxc.signal.reboot", "1", tmpf,
+                                           true) < 0) {
+               lxc_error("%s\n", "lxc.signal.reboot");
+               goto non_test_error;
+       }
+
+       /* REMOVE IN LXC 3.0
+          legacy lxc.stopsignal key
+        */
        if (set_get_compare_clear_save_load(c, "lxc.stopsignal", "1", tmpf,
                                            true) < 0) {
                lxc_error("%s\n", "lxc.stopsignal");
                goto non_test_error;
        }
 
+       /* lxc.signal.stop */
+       if (set_get_compare_clear_save_load(c, "lxc.signal.stop", "1", tmpf,
+                                           true) < 0) {
+               lxc_error("%s\n", "lxc.signal.stop");
+               goto non_test_error;
+       }
+
        /* lxc.start.auto */
        if (set_get_compare_clear_save_load(c, "lxc.start.auto", "1", tmpf,
                                            true) < 0) {
index 0d8db3358b54ca643a04c3f073da23d98454f678..7e11ac3e5a6ec0a500765eff92cdc32b952632dd 100644 (file)
@@ -341,7 +341,7 @@ copy_configuration()
 
 grep -q "^lxc.rootfs" $path/config 2>/dev/null || echo "lxc.rootfs = $rootfs" >> $path/config
 cat <<EOF >> $path/config
-lxc.haltsignal = SIGUSR1
+lxc.signal.halt = SIGUSR1
 lxc.rebootsignal = SIGTERM
 lxc.utsname = $name
 lxc.tty = 1