From 220db7656aac607c68ba23064ee59ed6802e073f Mon Sep 17 00:00:00 2001 From: Alfonso Acosta Date: Mon, 29 Feb 2016 18:01:07 +0000 Subject: [PATCH] Try to figure out the most suitable shell to use --- probe/docker/controls.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/probe/docker/controls.go b/probe/docker/controls.go index cb3303eb4..8977523e9 100644 --- a/probe/docker/controls.go +++ b/probe/docker/controls.go @@ -99,7 +99,7 @@ func (r *registry) execContainer(containerID string, req xfer.Request) xfer.Resp AttachStdout: true, AttachStderr: true, Tty: true, - Cmd: []string{"/bin/sh", "-c", "TERM=xterm exec /bin/sh"}, + Cmd: []string{"/bin/sh", "-c", "TERM=xterm exec $( (type getent > /dev/null 2>&1 && getent passwd root | cut -d: -f7 2>/dev/null) || echo /bin/sh)"}, Container: containerID, }) if err != nil {