Skip to content

Commit 24477e3

Browse files
committed
Add docker-specific instructions for running pihole-FTL supervised by valgrind in the container
Signed-off-by: DL6ER <[email protected]>
1 parent 51543da commit 24477e3

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

docs/ftldns/valgrind.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,28 @@ The used options are:
7575
When set to `yes`, Memcheck keeps track of the origins of all uninitialised values. Then, when an uninitialised value error is reported, Memcheck will try to show the origin of the value.
7676
4. `vgdb=full` - The Valgrind core provides a built-in gdbserver implementation. This is useful when you want to investigate a crash that is not easily reproducible and memory errors are suspected to be the cause. This gdbserver allows the process running on Valgrind's synthetic CPU to be debugged remotely. GDB sends protocol query packets (such as "get register contents") to the Valgrind embedded gdbserver. The gdbserver executes the queries (for example, it will get the register values of the synthetic CPU) and gives the results back to GDB.
7777

78+
<!-- markdownlint-disable code-block-style -->
79+
!!! info "When running Pi-hole in a Docker container"
80+
If you are running Pi-hole in a Docker container, you will need to perform all the steps described here *inside* the Docker container. As the Docker container is dependent on the `pihole-FTL` process, you need to modify your `Dockerfile` to spawn shell inside the container instead of starting the `pihole-FTL` process directly. We also add a few extra settings here, see [the `gdb` guide](gdb.md) for more information about this:
81+
82+
```yaml
83+
services:
84+
pihole:
85+
86+
# your other options ...
87+
88+
cap_add:
89+
- # your other added capabilities ...
90+
- SYS_PTRACE
91+
92+
security_opt:
93+
- seccomp:unconfined
94+
95+
entrypoint: /bin/bash
96+
tty: true
97+
```
98+
<!-- markdownlint-enable code-block-style -->
99+
78100
### Combining `valgrind` with `gdb`
79101

80102
You can also combine `valgrind` with `gdb` to get both the memory error detection and the ability to step through the code after a crash (or other unexpected behaviour).

0 commit comments

Comments
 (0)