]> code.delx.au - monosys/commitdiff
healthcheck fixes
authorJames Bunton <jamesbunton@delx.net.au>
Sat, 6 Jun 2020 14:21:36 +0000 (14:21 +0000)
committerJames Bunton <jamesbunton@delx.net.au>
Sat, 6 Jun 2020 14:21:36 +0000 (14:21 +0000)
healthcheck/packages
healthcheck/run-all
healthcheck/systemd-units
healthcheck/systemd-user-units [new file with mode: 0755]

index 87c691771fd77339d6d80eb48dbd93574e202f01..a8cf23c1ab791fe41cc0bb3ed807e7c7df0061c7 100755 (executable)
@@ -22,7 +22,7 @@ if is_debian; then
     aptorphan 1>&2
 
     echo "# aptitude search ~U"
     aptorphan 1>&2
 
     echo "# aptitude search ~U"
-    aptitude search ~U 1>&2
+    aptitude search ~U 1>&2 || true
 fi
 
 if is_arch; then
 fi
 
 if is_arch; then
index 2d57d516201bda32511305a9847bfaa4e1873615..0cb46ff022006596fde902aff9067fbf247e360d 100755 (executable)
@@ -7,7 +7,7 @@ set -eu
 cd "$(dirname "$(readlink -f "$0")")"
 
 for i in ./*; do
 cd "$(dirname "$(readlink -f "$0")")"
 
 for i in ./*; do
-    if [ "$i" != "$(basename "$0")" ]; then
+    if [ "$(basename "$i")" != "$(basename "$0")" ]; then
         if ! "$i"; then
             echo -e "\n^^ FAILED! $(hostname) $PRETTY_NAME -- $i ^^\n"
             exit 1
         if ! "$i"; then
             echo -e "\n^^ FAILED! $(hostname) $PRETTY_NAME -- $i ^^\n"
             exit 1
index 5eea8740af664cdfc1543d23e9ed6b7201ad13a2..8a6bc634818fda7f735d7c7b0e8873f9524bddde 100755 (executable)
@@ -1,9 +1,9 @@
 #!/bin/bash
 
 #!/bin/bash
 
-if systemctl is-failed -q '*'; then
-    echo -e "# systemctl --failed"
-    systemctl --failed
-    exit 1
-else
+if systemctl is-system-running > /dev/null; then
     exit 0
 fi
     exit 0
 fi
+
+echo -e "# systemctl --failed"
+systemctl --failed
+exit 1
diff --git a/healthcheck/systemd-user-units b/healthcheck/systemd-user-units
new file mode 100755 (executable)
index 0000000..5f8a406
--- /dev/null
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+if systemctl --user is-system-running > /dev/null; then
+    exit 0
+fi
+
+if systemctl --user is-system-running 2>&1 | grep -q 'Failed to connect to bus'; then
+    exit 0
+fi
+
+echo -e "# systemctl --user --failed"
+systemctl --user --failed
+exit 1