Commit 476d302c by Stéphane Graber

lxc-start: Add -F (foreground) option

Introduce a new -F option (no-op for now) as an opposite of -d. Signed-off-by: 's avatarStéphane Graber <stgraber@ubuntu.com> Acked-by: 's avatarSerge E. Hallyn <serge.hallyn@ubuntu.com>
parent b1814e1c
...@@ -54,6 +54,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -54,6 +54,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<arg choice="opt">-c <replaceable>console_device</replaceable></arg> <arg choice="opt">-c <replaceable>console_device</replaceable></arg>
<arg choice="opt">-L <replaceable>console_logfile</replaceable></arg> <arg choice="opt">-L <replaceable>console_logfile</replaceable></arg>
<arg choice="opt">-d</arg> <arg choice="opt">-d</arg>
<arg choice="opt">-F</arg>
<arg choice="opt">-p <replaceable>pid_file</replaceable></arg> <arg choice="opt">-p <replaceable>pid_file</replaceable></arg>
<arg choice="opt">-s KEY=VAL</arg> <arg choice="opt">-s KEY=VAL</arg>
<arg choice="opt">-C</arg> <arg choice="opt">-C</arg>
...@@ -107,6 +108,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ...@@ -107,6 +108,19 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<varlistentry> <varlistentry>
<term> <term>
<option>-F, --foreground</option>
</term>
<listitem>
<para>
Run the container in the foreground. In this mode, the container
console will be attached to the current tty and signals will be routed
directly to the container. (This is the default mode)
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<option>-p, --pidfile <replaceable>pid_file</replaceable></option> <option>-p, --pidfile <replaceable>pid_file</replaceable></option>
</term> </term>
<listitem> <listitem>
......
...@@ -147,6 +147,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg) ...@@ -147,6 +147,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
case 'c': args->console = arg; break; case 'c': args->console = arg; break;
case 'L': args->console_log = arg; break; case 'L': args->console_log = arg; break;
case 'd': args->daemonize = 1; break; case 'd': args->daemonize = 1; break;
case 'F': args->daemonize = 0; break;
case 'f': args->rcfile = arg; break; case 'f': args->rcfile = arg; break;
case 'C': args->close_all_fds = 1; break; case 'C': args->close_all_fds = 1; break;
case 's': return lxc_config_define_add(&defines, arg); case 's': return lxc_config_define_add(&defines, arg);
...@@ -160,6 +161,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg) ...@@ -160,6 +161,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
static const struct option my_longopts[] = { static const struct option my_longopts[] = {
{"daemon", no_argument, 0, 'd'}, {"daemon", no_argument, 0, 'd'},
{"foreground", no_argument, 0, 'F'},
{"rcfile", required_argument, 0, 'f'}, {"rcfile", required_argument, 0, 'f'},
{"define", required_argument, 0, 's'}, {"define", required_argument, 0, 's'},
{"console", required_argument, 0, 'c'}, {"console", required_argument, 0, 'c'},
...@@ -181,7 +183,8 @@ lxc-start start COMMAND in specified container NAME\n\ ...@@ -181,7 +183,8 @@ lxc-start start COMMAND in specified container NAME\n\
\n\ \n\
Options :\n\ Options :\n\
-n, --name=NAME NAME for name of the container\n\ -n, --name=NAME NAME for name of the container\n\
-d, --daemon daemonize the container\n\ -d, --daemon Daemonize the container\n\
-F, --foreground Start with the current tty attached to /dev/console (default)\n\
-p, --pidfile=FILE Create a file with the process id\n\ -p, --pidfile=FILE Create a file with the process id\n\
-f, --rcfile=FILE Load configuration file FILE\n\ -f, --rcfile=FILE Load configuration file FILE\n\
-c, --console=FILE Use specified FILE for the container console\n\ -c, --console=FILE Use specified FILE for the container console\n\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment