1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

make it possible to specify how many times ctdb killtcp will try to RST

the tcp connection

change the 60.nfs script to run ctdb killtcp in the foreground so we 
dont get lots of these running in parallel when there are a lot of tcp 
connections to rst

(This used to be ctdb commit d81616214752882242f2886e94681972a790db80)
This commit is contained in:
Ronnie Sahlberg 2007-07-10 10:24:20 +10:00
parent 1c32f65ee0
commit d81bca2072
2 changed files with 8 additions and 6 deletions

View File

@ -70,8 +70,8 @@ case $cmd in
srcport=`echo $src | cut -d: -f2`
destip=`echo $dest | cut -d: -f1`
destport=`echo $dest | cut -d: -f2`
ctdb killtcp $srcip:$srcport $destip:$destport >/dev/null 2>&1 &
ctdb killtcp $destip:$destport $srcip:$srcport >/dev/null 2>&1 &
ctdb killtcp $srcip:$srcport $destip:$destport 1 >/dev/null 2>&1
ctdb killtcp $destip:$destport $srcip:$srcport 1 >/dev/null 2>&1
done
} > /dev/null 2>&1
/bin/rm -f /etc/ctdb/state/nfs/restart

View File

@ -308,10 +308,10 @@ static int control_status(struct ctdb_context *ctdb, int argc, const char **argv
*/
static int kill_tcp(struct ctdb_context *ctdb, int argc, const char **argv)
{
int i, ret;
int i, ret, numrst;
struct sockaddr_in src, dst;
if (argc < 2) {
if (argc < 3) {
usage();
}
@ -325,7 +325,9 @@ static int kill_tcp(struct ctdb_context *ctdb, int argc, const char **argv)
return -1;
}
for (i=0;i<5;i++) {
numrst = strtoul(argv[2], NULL, 0);
for (i=0;i<numrst;i++) {
ret = ctdb_sys_kill_tcp(ctdb->ev, &src, &dst);
printf("ret:%d\n", ret);
@ -889,7 +891,7 @@ static const struct {
{ "recover", control_recover, true, "force recovery" },
{ "freeze", control_freeze, true, "freeze all databases" },
{ "thaw", control_thaw, true, "thaw all databases" },
{ "killtcp", kill_tcp, false, "kill a tcp connection", "<srcip:port> <dstip:port>" },
{ "killtcp", kill_tcp, false, "kill a tcp connection. Try <num> times.", "<srcip:port> <dstip:port> <num>" },
{ "tickle", tickle_tcp, false, "send a tcp tickle ack", "<srcip:port> <dstip:port>" },
};