--- /dev/null
+#!/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-z0-9-]*@.*\.service$ ]] ||
+ [[ $service =~ ^session-[0-9]+\.scope$ ]]; then
+ systemctl reset-failed "$service"
+ fi
+done