#!/bin/sh # a script to test the basic setup of a CTDB/Samba install # tridge@samba.org September 2007 PATH="$PATH:/sbin:/usr/sbin:/usr/lpp/mmfs/bin" CONFIG_FILES="/etc/krb5.conf /etc/hosts /etc/ctdb/nodes /etc/sysconfig/ctdb /etc/ctdb/public_addresses /etc/resolv.conf /etc/nsswitch.conf /etc/sysctl.conf /etc/samba/smb.conf /etc/fstab /etc/multipath.conf /etc/pam.d/system-auth /etc/sysconfig/nfs /etc/exports /etc/vsftpd/vsftpd.conf" 2>&1 cat <> $ERRORS } show_file() { fname="$1" echo " ================================" echo " File: $fname" echo " `ls -l $fname 2>&1`" cat "$fname" 2>&1 | sed 's/^/ /' echo " ================================" } show_all() { echo "running $1 on all nodes" onnode all "hostname; date; $1 2>&1 | sed 's/^/ /'" } ERRORS="/tmp/diag_err.$$" NUM_NODES=`wc -l < /etc/ctdb/nodes` MAX_NODE=`expr $NUM_NODES - 1` NUM_ERRORS=0 cat < $tmpf 2>&1 cmp $f $tmpf 2>&1 || { error "File $f is different on node $i" diff -u $f $tmpf } rm -f $tmpf done done cat < /dev/null` show_all id "$WORKGROUP/Administrator" show_all "wbinfo -p" show_all "wbinfo --sequence" show_all "smbd -b" date echo "Diagnostics finished with $NUM_ERRORS errors" [ -r $ERRORS ] && { cat $ERRORS rm -f $ERRORS } exit $NUM_ERRORS