Permalink
Browse files

Enable sig-proxy by default in run and attach

  • Loading branch information...
vieux committed Oct 29, 2013
1 parent 76afb6e commit af67913bd235dc8843942db79ab442fe65b52ac2
Showing with 7 additions and 8 deletions.
  1. +4 −1 commands.go
  2. +1 −5 container.go
  3. +2 −2 docs/sources/commandline/cli.rst
View
@@ -1313,7 +1313,7 @@ func (cli *DockerCli) CmdLogs(args ...string) error {
func (cli *DockerCli) CmdAttach(args ...string) error {
cmd := Subcmd("attach", "[OPTIONS] CONTAINER", "Attach to a running container")
noStdin := cmd.Bool("nostdin", false, "Do not attach stdin")
proxy := cmd.Bool("sig-proxy", false, "Proxify all received signal to the process (even in non-tty mode)")
proxy := cmd.Bool("sig-proxy", true, "Proxify all received signal to the process (even in non-tty mode)")
if err := cmd.Parse(args); err != nil {
return nil
}
@@ -1523,6 +1523,9 @@ func (cli *DockerCli) CmdRun(args ...string) error {
flSigProxy := cmd.Lookup("sig-proxy")
sigProxy, _ := strconv.ParseBool(flSigProxy.Value.String())
if config.Tty {
sigProxy = false
}
var containerIDFile *os.File
if len(hostConfig.ContainerIDFile) > 0 {
View
@@ -103,7 +103,6 @@ var (
ErrContainerStart = errors.New("The container failed to start. Unkown error")
ErrContainerStartTimeout = errors.New("The container failed to start due to timed out.")
ErrInvalidWorikingDirectory = errors.New("The working directory is invalid. It needs to be an absolute path.")
ErrConflictTtySigProxy = errors.New("TTY mode (-t) already imply signal proxying (-sig-proxy)")
ErrConflictAttachDetach = errors.New("Conflicting options: -a and -d")
ErrConflictDetachAutoRemove = errors.New("Conflicting options: -rm and -d")
)
@@ -133,7 +132,7 @@ func ParseRun(args []string, capabilities *Capabilities) (*Config, *HostConfig,
flNetwork := cmd.Bool("n", true, "Enable networking for this container")
flPrivileged := cmd.Bool("privileged", false, "Give extended privileges to this container")
flAutoRemove := cmd.Bool("rm", false, "Automatically remove the container when it exits (incompatible with -d)")
flSigProxy := cmd.Bool("sig-proxy", false, "Proxify all received signal to the process (even in non-tty mode)")
cmd.Bool("sig-proxy", true, "Proxify all received signal to the process (even in non-tty mode)")
if capabilities != nil && *flMemory > 0 && !capabilities.MemoryLimit {
//fmt.Fprintf(stdout, "WARNING: Your kernel does not support memory limit capabilities. Limitation discarded.\n")
@@ -171,9 +170,6 @@ func ParseRun(args []string, capabilities *Capabilities) (*Config, *HostConfig,
if *flWorkingDir != "" && !path.IsAbs(*flWorkingDir) {
return nil, nil, cmd, ErrInvalidWorikingDirectory
}
if *flTty && *flSigProxy {
return nil, nil, cmd, ErrConflictTtySigProxy
}
if *flDetach && *flAutoRemove {
return nil, nil, cmd, ErrConflictDetachAutoRemove
}
@@ -30,7 +30,7 @@ To list available commands, either run ``docker`` with no parameters or execute
Attach to a running container.
-nostdin=false: Do not attach stdin
-sig-proxy=false: Proxify all received signal to the process (even in non-tty mode)
-sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
You can detach from the container again (and leave it running) with
``CTRL-c`` (for a quiet exit) or ``CTRL-\`` to get a stacktrace of
@@ -553,7 +553,7 @@ Insert file from github
-entrypoint="": Overwrite the default entrypoint set by the image.
-w="": Working directory inside the container
-lxc-conf=[]: Add custom lxc options -lxc-conf="lxc.cgroup.cpuset.cpus = 0,1"
-sig-proxy=false: Proxify all received signal to the process (even in non-tty mode)
-sig-proxy=true: Proxify all received signal to the process (even in non-tty mode)
Examples
~~~~~~~~

0 comments on commit af67913

Please sign in to comment.