ops: add core backtrace helper

This commit is contained in:
server
2026-04-14 17:01:50 +02:00
parent c5bb515781
commit 0bc6559283
5 changed files with 245 additions and 0 deletions

View File

@@ -47,6 +47,7 @@ The Debian deployment installs:
- restarting the whole stack or specific channels/instances
- viewing logs
- listing core files in the runtime tree
- generating a backtrace for the newest or selected core file
- collecting incident bundles
- running the root-only headless healthcheck
- waiting for login-ready state after restart
@@ -185,6 +186,18 @@ List core files currently present in the runtime tree:
metinctl cores
```
Generate a backtrace for the newest core file:
```bash
metinctl backtrace
```
Generate a backtrace for one specific core file:
```bash
metinctl backtrace --core channels/channel1/core1/core.2255450
```
Collect an incident bundle with logs, unit status, port state and repository revisions:
```bash
@@ -214,6 +227,7 @@ This makes channel enablement declarative instead of depending on whatever happe
The Debian deployment now also installs:
- `/usr/local/sbin/metin-collect-incident`
- `/usr/local/sbin/metin-core-backtrace`
The collector creates a timestamped bundle under:
@@ -231,3 +245,11 @@ Each bundle contains:
If you call it with `--include-cores`, matching core files are copied into the bundle as well.
The runtime units now also declare `LimitCORE=infinity`, so after the next service restart the processes are allowed to emit core dumps when the host kernel/core policy permits it.
For quick manual crash triage outside the incident bundle flow, use:
```bash
metinctl backtrace
```
It defaults to the newest core file under the runtime tree, infers the executable path, and uses `gdb` or `lldb` when present on the host. If no supported debugger is installed, it still prints file/readelf metadata for the core and executable.