From 520a0f654a25870a533d6feff5f26669eaaa4ac6 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 29 Jan 2019 13:42:00 +0100 Subject: [dnbd3-proxy-mode] Watch for hash check fails and log to server --- .../data/etc/systemd/system/dnbd3-logwatch.service | 8 ++++++++ .../system/dnbd3-proxy.target.requires/dnbd3-logwatch.service | 1 + .../data/opt/openslx/scripts/systemd-dnbd3_logwatch | 8 ++++++++ 3 files changed, 17 insertions(+) create mode 100644 core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service create mode 120000 core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service create mode 100755 core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch (limited to 'core/modules/dnbd3-proxy-mode') diff --git a/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service new file mode 100644 index 00000000..2d76781c --- /dev/null +++ b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-logwatch.service @@ -0,0 +1,8 @@ +[Unit] +Description=DNBD3 monitor reporting to Satellite Server + +[Service] +ExecStart=/opt/openslx/scripts/systemd-dnbd3_logwatch +Restart=always +RestartSec=5 +TimeoutStopSec=2 diff --git a/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service new file mode 120000 index 00000000..56096070 --- /dev/null +++ b/core/modules/dnbd3-proxy-mode/data/etc/systemd/system/dnbd3-proxy.target.requires/dnbd3-logwatch.service @@ -0,0 +1 @@ +../dnbd3-logwatch.service \ No newline at end of file diff --git a/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch new file mode 100755 index 00000000..f390495d --- /dev/null +++ b/core/modules/dnbd3-proxy-mode/data/opt/openslx/scripts/systemd-dnbd3_logwatch @@ -0,0 +1,8 @@ +#!/bin/ash + +journalctl -f -n 0 -u dnbd3-proxy \ + | grep --line-buffered -F -i -e 'crc ' -e 'crc32' -e 'hash check' \ + | while read -r line; do slxlog "dnbd3-hashfail" "$line"; done + +exit 0 + -- cgit v1.2.3-55-g7522