aboutsummaryrefslogtreecommitdiff
path: root/etc/private/vm-login
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2020-09-04 13:10:33 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2020-09-04 13:10:33 +0200
commit9f6b17a091222f8240194ae331f64e92ed2c3c28 (patch)
treeb83996996a6a6cee463e11fc884becd16946ea54 /etc/private/vm-login
parentb026efa58533e7ce1f04bf9fbb8eb5e7da19db65 (diff)
Update private VM management scripts
Diffstat (limited to 'etc/private/vm-login')
-rwxr-xr-xetc/private/vm-login8
1 files changed, 6 insertions, 2 deletions
diff --git a/etc/private/vm-login b/etc/private/vm-login
index 3b501ca..4573cba 100755
--- a/etc/private/vm-login
+++ b/etc/private/vm-login
@@ -1,6 +1,8 @@
#! /usr/bin/env bash
-# Get virtual machine console.
+# Get virtual machine console (using screen).
+#
+# Note: use Ctrl-a k to exit screen (or Ctrl-a a k if running inside screen).
#
usage="usage: $0 <console-socket>"
@@ -22,7 +24,9 @@ pty="$(dirname "$con")/$(basename -s .sock "$con").pty"
socat "UNIX-CONNECT:$con" "PTY,link=$pty" &
pid="$!"
-screen "$pty"
+# Hack around terminal permission issue when running under `su - <user>`.
+#
+script -q -c "screen $pty" /dev/null
# Note: socat may have already terminated (e.g., VM was shut down).
#