Move failed rsync cleanup into systemd module
authorPeter Palfrader <peter@palfrader.org>
Sun, 11 Feb 2018 09:58:08 +0000 (10:58 +0100)
committerPeter Palfrader <peter@palfrader.org>
Sun, 11 Feb 2018 09:59:10 +0000 (10:59 +0100)
modules/rsync/files/systemd-cleanup-failed-rsyncs [deleted file]
modules/rsync/manifests/init.pp
modules/systemd/files/systemd-cleanup-failed [new file with mode: 0755]
modules/systemd/manifests/init.pp

diff --git a/modules/rsync/files/systemd-cleanup-failed-rsyncs b/modules/rsync/files/systemd-cleanup-failed-rsyncs
deleted file mode 100755 (executable)
index 5cde92b..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/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
index a80582c..686843c 100644 (file)
@@ -25,14 +25,6 @@ class rsync {
        }
 
        file { '/usr/local/sbin/systemd-cleanup-failed-rsyncs':
-               source => 'puppet:///modules/rsync/systemd-cleanup-failed-rsyncs',
-               mode   => '0555',
-       }
-       file { '/etc/cron.d/puppet-crazy-multipath-restart': ensure => absent, }
-       concat::fragment { 'dsa-puppet-stuff--systemd-cleanup-failed-rsyncs':
-               target => '/etc/cron.d/dsa-puppet-stuff',
-               content  => @("EOF"),
-                               */10 * * * * root /usr/local/sbin/systemd-cleanup-failed-rsyncs
-                               | EOF
+               ensure => absent,
        }
 }
diff --git a/modules/systemd/files/systemd-cleanup-failed b/modules/systemd/files/systemd-cleanup-failed
new file mode 100755 (executable)
index 0000000..5cde92b
--- /dev/null
@@ -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
index d5b896d..1dd41cd 100644 (file)
@@ -15,4 +15,14 @@ class systemd {
                }
        }
 
+       file { '/usr/local/sbin/systemd-cleanup-failed':
+               source => 'puppet:///modules/systemd/systemd-cleanup-failed',
+               mode   => '0555',
+       }
+       concat::fragment { 'dsa-puppet-stuff--systemd-cleanup-failed':
+               target => '/etc/cron.d/dsa-puppet-stuff',
+               content  => @("EOF"),
+                               */10 * * * * root /usr/local/sbin/systemd-cleanup-failed
+                               | EOF
+       }
 }