summaryrefslogtreecommitdiffstats
path: root/share
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@open-infrastructure.net>2019-10-22 08:32:00 +0000
committerDaniel Baumann <daniel.baumann@open-infrastructure.net>2019-11-04 06:01:41 +0000
commitdff790029ca17811a04fdda3069fc5c0a1a729ec (patch)
tree24aa3af1076a283bfefe3b22f583f08754501313 /share
parentTightening Address lookup in container list command for systemd-networkd to n... (diff)
downloadcompute-tools-dff790029ca17811a04fdda3069fc5c0a1a729ec.tar.xz
compute-tools-dff790029ca17811a04fdda3069fc5c0a1a729ec.zip
Adding default hook to unlink console prior start when bindmounting /dev (e.g. in GPU computing cases).
Signed-off-by: Daniel Baumann <daniel.baumann@open-infrastructure.net>
Diffstat (limited to '')
-rw-r--r--share/hooks/pre-start.unlink-console.sh8
1 files changed, 8 insertions, 0 deletions
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