Skip to content

Commit ddf233f

Browse files
committed
docs/DEBUGGING.md: add 'application console' section
The application console section describes usage of application consoles. Signed-off-by: Roman Penyaev <[email protected]>
1 parent 5618a2b commit ddf233f

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

docs/DEBUGGING.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,75 @@ tail -F /run/diag.out
9393

9494
In addition this information is provided to application instances on the device using [the diag API endpoint](./ECO-METADATA.md).
9595

96+
## Application console
97+
98+
A running application on an EVE device has a console for input or output. You can attach to the application console from the EVE device as a control terminal if the application (VM or Container) listens to the TTY line and communicates with the virtual console /dev/hvc0 device. For example for popular linux distributions deployed as VM application this is usually the case.
99+
100+
First list applications consoles of all running QEMU (KVM) processes:
101+
102+
```bash
103+
# eve list-app-consoles
104+
PID APP-UUID CONS-TYPE CONS-ID
105+
--- -------- --------- ---------
106+
3883 e4e2f56d-b833-4562-a86f-be654d6387ba VM e4e2f56d-b833-4562-a86f-be654d6387ba.1.1/cons
107+
4072 f6d348cc-9c31-4f8b-8c4f-a4aae4590b97 CONTAINER f6d348cc-9c31-4f8b-8c4f-a4aae4590b97.1.2/cons
108+
4072 f6d348cc-9c31-4f8b-8c4f-a4aae4590b97 VM f6d348cc-9c31-4f8b-8c4f-a4aae4590b97.1.2/prime-cons
109+
110+
```
111+
112+
Where fields are:
113+
114+
* PID - the process ID of the QEMU process
115+
* APP-UUID - UUID of the application
116+
* CONS-TYPE - Type of the console
117+
* CONS-ID - ID of the console, should be used for attaching to the console by passing the console ID to the `eve attach-app-console` command
118+
119+
Different application types may have different consoles (as mentioned above). An application of type "Virtual Machine" can only have a console of type "VM", which leads to the console of the user application; An application of the "Container" type has two types of console: the console of the "VM" type leads to the Virtual Machine that hosts the container, the console of the "CONTAINER" type leads to the user container itself.
120+
121+
Choose console ID you need to attach and pass it as an argument to the `eve attach-app-console` command:
122+
123+
```bash
124+
# eve attach-app-console e4e2f56d-b833-4562-a86f-be654d6387ba.1.1/cons
125+
[20:26:15.116] tio v1.37
126+
[20:26:15.116] Press ctrl-t q to quit
127+
[20:26:15.116] Connected
128+
<PRESS ENTER>
129+
130+
Ubuntu 18.04.6 LTS user hvc0
131+
132+
user login:
133+
```
134+
135+
Note: `tio` utility is used as a simple TTY terminal, so in order to quit the session please press `ctrl-t q` or read the `tio` manual for additional commands.
136+
137+
The same 'cons' console ID can be used for the Container application, but please be aware if container does not start a shell then terminal is very limited and can be used only for reading for the console output, but not for executing commands.
138+
139+
In order to attach to the console of the hosting Vm of the Container application another console ID should be used which is named `prime-cons`:
140+
141+
```bash
142+
# eve attach-app-console f6d348cc-9c31-4f8b-8c4f-a4aae4590b97.1.2/prime-cons
143+
[20:41:47.124] tio v1.37
144+
[20:41:47.124] Press ctrl-t q to quit
145+
[20:41:47.124] Connected
146+
<PRESS ENTER>
147+
~ #
148+
```
149+
150+
The `prime-cons` console exists only for the Container applications and is always reachable for executing commands on the Vm which hosts corresponding container.
151+
152+
Once terminal responds on the `prime-cons` console it is possible to enter container by executing the `eve-enter-container` command:
153+
154+
```bash
155+
~ # eve-enter-container
156+
(none):/# ps awux
157+
PID USER TIME COMMAND
158+
1 root 0:00 /bin/sh
159+
6 root 0:00 -ash
160+
7 root 0:00 ps awux
161+
(none):/# exit
162+
~ #
163+
```
164+
96165
## Reboots
97166

98167
EVE is architected in such a way that if any service is unresponsive for a period of time, the entire device will reboot. When this happens a BootReason is constructed and sent in the device info message to the controller. If there is a golang panic there can also be useful information found in `/persist/agentdebug/`.

0 commit comments

Comments
 (0)