From f3ff81f4f31cd3ecb5d648caff674663943db42f Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Mon, 23 Aug 2021 21:04:59 +0200 Subject: container: op-mode: T3765: "connect container" will now drop you to a shell Commit a30d74f4 (container: op-mode: T3765: add "connect container mysql-server") added a CLI op-mode command to attach to a container - users typically not want to attach and consume stdout (can be done via logs) but rather wan't to debug inside the container image. vyos@vyos:~$ connect container unifi USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND root 202 0.0 0.0 4640 828 pts/1 Ss 21:06 0:00 /bin/sh root 203 0.0 0.0 34416 2872 pts/1 R+ 21:06 0:00 \_ ps faux root 187 0.0 0.0 18388 3124 ? S 21:03 0:00 /bin/bash root 186 0.0 0.0 4640 788 ? S 21:03 0:00 /bin/sh root 185 0.0 0.0 4640 824 ? S 21:03 0:00 /bin/sh root 184 0.0 0.0 4640 836 ? S 21:03 0:00 /bin/sh root 1 0.0 0.0 18520 3228 pts/0 Ss+ 20:50 0:00 bash /usr/local/bin/docker-entrypoint.sh unifi root 12 4.8 14.2 3688080 572756 pts/0 Sl+ 20:50 0:48 java -Dunifi.datadir=/unifi/data -Dunifi.logdir=/unifi/log -Dunifi.rundir=/var/run/unifi - root 35 0.7 3.4 1102700 139752 pts/0 Sl+ 20:50 0:07 \_ bin/mongod --dbpath /usr/lib/unifi/data/db --port 27117 --unixSocketPrefix /usr/lib/un Linux 57c689f739ed 5.10.60-amd64-vyos #1 SMP Fri Aug 20 14:44:59 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux --- op-mode-definitions/containers.xml.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'op-mode-definitions/containers.xml.in') diff --git a/op-mode-definitions/containers.xml.in b/op-mode-definitions/containers.xml.in index efa72e1a4..b2b318786 100644 --- a/op-mode-definitions/containers.xml.in +++ b/op-mode-definitions/containers.xml.in @@ -26,7 +26,7 @@ container name - echo "Use Ctrl+p and Ctrl+q to detach"; sudo podman attach "$3" + sudo podman exec --interactive --tty "$3" /bin/sh -- cgit v1.2.3