/usr/local/bin/opensnitch-docker-watchdog.sh
/etc/systemd/system/opensnitch-docker-watchdog.service
/usr/local/bin/opensnitch-docker-watchdog.sh
/etc/systemd/system/opensnitch-docker-watchdog.service
/usr/local/bin/opensnitch-docker-watchdog.sh
/etc/systemd/system/opensnitch-docker-watchdog.service
#!/usr/bin/env bash
set -euo pipefail docker events \ --filter event=start \ --filter event=restart \ --format '{{.Time}} {{.Actor.Attributes.name}}' | \
while read -r event; do logger -t opensnitch-watchdog "Container event: $event" kill -HUP "$(pgrep opensnitchd)" 2>/dev/null || true
done
#!/usr/bin/env bash
set -euo pipefail docker events \ --filter event=start \ --filter event=restart \ --format '{{.Time}} {{.Actor.Attributes.name}}' | \
while read -r event; do logger -t opensnitch-watchdog "Container event: $event" kill -HUP "$(pgrep opensnitchd)" 2>/dev/null || true
done
#!/usr/bin/env bash
set -euo pipefail docker events \ --filter event=start \ --filter event=restart \ --format '{{.Time}} {{.Actor.Attributes.name}}' | \
while read -r event; do logger -t opensnitch-watchdog "Container event: $event" kill -HUP "$(pgrep opensnitchd)" 2>/dev/null || true
done
[Unit]
Description=OpenSnitch docker-proxy PID rotation watchdog
After=docker.service opensnitch.service
Requires=docker.service opensnitch.service [Service]
Type=simple
ExecStart=/usr/local/bin/opensnitch-docker-watchdog.sh
Restart=on-failure
RestartSec=5 [Install]
WantedBy=multi-user.target
[Unit]
Description=OpenSnitch docker-proxy PID rotation watchdog
After=docker.service opensnitch.service
Requires=docker.service opensnitch.service [Service]
Type=simple
ExecStart=/usr/local/bin/opensnitch-docker-watchdog.sh
Restart=on-failure
RestartSec=5 [Install]
WantedBy=multi-user.target
[Unit]
Description=OpenSnitch docker-proxy PID rotation watchdog
After=docker.service opensnitch.service
Requires=docker.service opensnitch.service [Service]
Type=simple
ExecStart=/usr/local/bin/opensnitch-docker-watchdog.sh
Restart=on-failure
RestartSec=5 [Install]
WantedBy=multi-user.target
systemctl status opensnitch-docker-watchdog
systemctl status opensnitch-docker-watchdog
systemctl status opensnitch-docker-watchdog
journalctl -t opensnitch-watchdog -f
journalctl -t opensnitch-watchdog -f
journalctl -t opensnitch-watchdog -f - Find the event source that announces the change (Docker events, inotify, dbus, udev, the daemon's own pub-sub if it has one).
- Find the cheap signal that re-syncs the consumer (SIGHUP, a reload endpoint, a control socket command).
- Tie them together in the smallest possible script.
- Put it under systemd with explicit After= and Requires= to its prerequisites.
- Add the verification ritual that proves it works.