X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;f=modules%2Fsystemd%2Ffiles%2Fsystemd-cleanup-failed;fp=modules%2Fsystemd%2Ffiles%2Fsystemd-cleanup-failed;h=5cde92b45bfd1c63c59573d364b7b90dfd9fa1b2;hb=08a21d49a4973b76493e3a50d25c3e98f07cb92b;hp=0000000000000000000000000000000000000000;hpb=208cac1321b9a101641ba7c9f1c2c5e550060a86;p=mirror%2Fdsa-puppet.git diff --git a/modules/systemd/files/systemd-cleanup-failed b/modules/systemd/files/systemd-cleanup-failed new file mode 100755 index 000000000..5cde92b45 --- /dev/null +++ b/modules/systemd/files/systemd-cleanup-failed @@ -0,0 +1,15 @@ +#!/bin/bash + +# if a client goes away on socket activated connections before systemd launches +# the process, things go sad and result in failed services. +# +# cf. https://github.com/systemd/systemd/issues/7172 +# +# should be fixed in buster and newer, but for now clean those up. + +systemctl --failed --no-legend | awk '{print $1}' | \ + while read service; do + if [[ $service =~ ^rsyncd-[a-z]*@.*\.service$ ]]; then + systemctl reset-failed "$service" + fi +done