Nouveau check samba qui fait en sorte de ne pas relancer zamok en plein milieu
d'une lection et surtout qui kille tous les nmbd rcalcitrants si a ne tourne pas rond. N. darcs-hash:20030130183444-a279a-08fdbd0509215fcbd79108031ac159f741bdfe46.gz
This commit is contained in:
parent
3f171cfae3
commit
2a8da503f1
1 changed files with 29 additions and 8 deletions
37
check-samba
37
check-samba
|
@ -1,15 +1,36 @@
|
||||||
#!/bin/zsh
|
#!/bin/zsh
|
||||||
#script shell par kif 01/10/00
|
##
|
||||||
|
## check-samba
|
||||||
|
##
|
||||||
|
## Made by stransky
|
||||||
|
## Login stransky <stransky@crans.org>
|
||||||
|
##
|
||||||
|
## Started on jeu 01 oct 2000 19:25:35 CET Jérôme Kieffer
|
||||||
|
## Last update jeu 30 jan 2003 19:25:35 CET Nicolas STRANSKY
|
||||||
|
##
|
||||||
|
# surveillance de nmbd
|
||||||
|
|
||||||
LOG=/var/log/cransMisc/samba-master.log
|
LOG=/var/log/cransMisc/samba-master.log
|
||||||
master=`smbclient -N -L zamok |grep -A5 Master |grep CRANS |tail -c 6 `
|
|
||||||
|
master=$(smbclient -N -L zamok |grep -A5 Master |grep CRANS | awk '{print $2}')
|
||||||
|
|
||||||
if [ "$master" != 'ZAMOK' ];
|
if [ "$master" != 'ZAMOK' ];
|
||||||
then
|
then
|
||||||
echo -n `date` >> $LOG
|
# on attend pour être sûr que zamok n'est pas justement en train de déclencher une élection :
|
||||||
echo " : le maitre est $master " >> $LOG
|
sleep 20
|
||||||
echo "Zamok n'est plus maitre ; je relance samba" >> $LOG
|
# on refait le test :
|
||||||
/id/samba restart >> $LOG 2>&1
|
master=$(smbclient -N -L zamok |grep -A5 Master |grep CRANS | awk '{print $2}')
|
||||||
#else
|
# Si on est sûr que ça chie, on sort les armes :
|
||||||
# echo zamok est encore maitre
|
if [ "$master" != 'ZAMOK' ];
|
||||||
|
then
|
||||||
|
date=`date`
|
||||||
|
echo "$date : Crans local master is $master " >> $LOG
|
||||||
|
echo "$date : restarting samba" >> $LOG
|
||||||
|
echo -n $date >> $LOG
|
||||||
|
/id/samba stop >> $LOG 2>&1
|
||||||
|
echo -n $date >> $LOG
|
||||||
|
killall -9 nmbd >> $LOG 2>&1 # tant qu'à faire on peut killer complètement nmbd
|
||||||
|
echo -n $date >> $LOG
|
||||||
|
/id/samba start >> $LOG 2>&1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue