X-Git-Url: https://git.stderr.nl/gitweb?a=blobdiff_plain;f=handlers%2Fsys.in;h=cc8ed095931fcaa6de46113ccd6ccd7caf1e0a1b;hb=f1cb4e9a644ce0ad5c2879cb1713b70eace3f98a;hp=2c48883ce11576639a7ae7231249b59ccd840c6f;hpb=33ff4f7506fcaab09fd7ad898507f37b7777ba8f;p=matthijs%2Fupstream%2Fbackupninja.git diff --git a/handlers/sys.in b/handlers/sys.in index 2c48883..cc8ed09 100755 --- a/handlers/sys.in +++ b/handlers/sys.in @@ -53,8 +53,8 @@ then getconf packagesfile $parentdir/dpkg-selections.txt getconf packagemgr `which dpkg` getconf packagemgroptions ' --get-selections *' - getconf selectionsfile $parentir/debconfsel.txt - getconf debconfgetselections `debconf-get-selections` + getconf selectionsfile $parentdir/debconfsel.txt + getconf debconfgetselections `which debconf-get-selections` elif [ $os = "redhat" ] then getconf packagesfile $parentdir/rpmpackages.txt @@ -126,11 +126,11 @@ if [ "$packages" == "yes" ]; then set +o noglob fi # is $debconfgetselections available inside $vserver ? - if [ ! -x "$VROOTDIR/$vserver`$VSERVER $vserver exec which $debconfgetselections`" ]; then - warning "can't find $debconfgetselections in vserver $vserver, skipping package selection states." + if [ -z "`$VSERVER $vserver exec which debconf-get-selections`" ]; then + warning "can't find debconf-get-selections in vserver $vserver, skipping package selection states." else debug "$VSERVER $vserver exec $debconfgetselections > $VROOTDIR/$vserver$selectionsfile" - $VSERVER $vserver exec $debconfgetselections > $VROOTDIR/$vserver$selectionsfile || fatal "can not save $debconfgetselections info to $selectionsfile" + $VSERVER $vserver exec $debconfgetselections > $VROOTDIR/$vserver$selectionsfile || fatal "can not save debconf-get-selections info to $selectionsfile" fi done fi @@ -188,10 +188,12 @@ catiffile () { } catifexec () { - echo $HASHES >> $sysreportfile - echo "# $STATUS" >> $sysreportfile - echo $HASHES >> $sysreportfile - $1 >> $sysreportfile 2>&1 || info "executing of $1 failed" + if [ -x $1 ]; then + echo $HASHES >> $sysreportfile + echo "# $STATUS" >> $sysreportfile + echo $HASHES >> $sysreportfile + $* >> $sysreportfile 2>&1 || info "executing of $1 failed" + fi } @@ -380,7 +382,7 @@ STATUS="Gathering information about your ide drivers:" catiffile "/proc/ide" STATUS="Gathering information about your bus:" -catifexec lspci +catifexec "/usr/bin/lspci" catiffile "/proc/bus" echo @@ -391,7 +393,7 @@ STATUS="Collecting information from /etc/fstab:" catiffile "/etc/fstab" STATUS="Collecting disk partition information:" -catifexec "fdisk -l" +catifexec "/sbin/fdisk -l" STATUS="Checking mounted file systems (mount) " catifexec "/bin/mount" @@ -408,6 +410,9 @@ catiffile "/etc/raidtab" 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?*' + STATUS="Collecting Automount information (auto.master)" catiffile "/etc/auto.master"