sys: only run mdadm if RAID devices actually exist (Closes: #572450)
[matthijs/upstream/backupninja.git] / handlers / sys.in
index 2ab58710aa2d5eb2cc54054e13369f137ee85ebe..a92663e23766b43c9ed26ecb4e62d21d46effc70 100755 (executable)
@@ -1,4 +1,5 @@
 # -*- mode: sh; sh-basic-offset: 3; indent-tabs-mode: nil; -*-
+# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
 #
 # this handler will save various reports of vital system information.
 # by default, all the reports are saved in /var/backups.
@@ -461,7 +462,9 @@ STATUS="Collecting Software RAID information (/etc/mdadm.conf)"
 catiffile "/etc/mdadm.conf"
 
 STATUS="Collecting Software RAID information (/sbin/mdadm -Q)"
-catifexec "/sbin/mdadm" "-Q" "--detail" '/dev/md?*'
+if ls /dev/md?* >/dev/null 2>&1; then
+   catifexec "/sbin/mdadm" "-Q" "--detail" '/dev/md?*'
+fi
 
 STATUS="Collecting Automount information (auto.master)"
 catiffile "/etc/auto.master"