Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame^] | 1 | From 3fff2a3505fba1d1ff0074edff15708a77f6cfa9 Mon Sep 17 00:00:00 2001 |
| 2 | From: Jason Wessel <jason.wessel@windriver.com> |
| 3 | Date: Wed, 12 Jul 2017 13:35:03 -0700 |
| 4 | Subject: [PATCH] runc: Add --console-socket=/dev/null |
| 5 | |
| 6 | This allows for setting up a detached session where you do not want to |
| 7 | set the terminal to false in the config.json. More or less this is a |
| 8 | runtime override. |
| 9 | |
| 10 | Signed-off-by: Jason Wessel <jason.wessel@windriver.com> |
| 11 | --- |
| 12 | utils_linux.go | 5 +++++ |
| 13 | 1 file changed, 5 insertions(+) |
| 14 | |
| 15 | diff --git a/utils_linux.go b/utils_linux.go |
| 16 | index 8085f7fe..e6d31b35 100644 |
| 17 | --- a/src/import/utils_linux.go |
| 18 | +++ b/src/import/utils_linux.go |
| 19 | @@ -227,6 +227,11 @@ type runner struct { |
| 20 | } |
| 21 | |
| 22 | func (r *runner) run(config *specs.Process) (int, error) { |
| 23 | + if (r.consoleSocket == "/dev/null") { |
| 24 | + r.detach = false |
| 25 | + r.consoleSocket = "" |
| 26 | + config.Terminal = false |
| 27 | + } |
| 28 | if err := r.checkTerminal(config); err != nil { |
| 29 | r.destroy() |
| 30 | return -1, err |
| 31 | -- |
| 32 | 2.11.0 |
| 33 | |