summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlib/container/start3
-rw-r--r--share/hooks/pre-start.unlink-console.sh8
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/container/start b/lib/container/start
index 47c2907..13fc6ef 100755
--- a/lib/container/start
+++ b/lib/container/start
@@ -101,6 +101,9 @@ then
Usage
fi
+# hooks
+export NAME
+
case "${NAME}" in
ALL)
NAMES="$(${PROGRAM} list --format shell --stopped)"
diff --git a/share/hooks/pre-start.unlink-console.sh b/share/hooks/pre-start.unlink-console.sh
new file mode 100644
index 0000000..762ab0e
--- /dev/null
+++ b/share/hooks/pre-start.unlink-console.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+set -e
+
+if grep -qs 'bind=.*/dev:/dev;' "/etc/open-infrastructure/container/config/${NAME}.conf"
+then
+ unlink /dev/console > /dev/null 2>&1 || true
+fi