~ubuntu-branches/debian/sid/resource-agents/sid

« back to all changes in this revision

Viewing changes to ldirectord/ldirectord.in

  • Committer: Package Import Robot
  • Author(s): Martin Loschwitz
  • Date: 2012-10-09 11:16:59 UTC
  • mfrom: (3.1.1)
  • Revision ID: package-import@ubuntu.com-20121009111659-jrcwfqskcbh0iuio
Tags: 1:3.9.3+git20121009-1
* New upstream version
* debian/patches/01_docbook_patch.patch: Refactored for new release
* debian/patches/02_spelling_fixes.patch.new: Refatored for new release
* debian/control: Bumped Standards-Version to 3.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
338
338
 
339
339
Default: I<yes>
340
340
 
 
341
B<readdquiescent = >B<yes> | B<no>
 
342
 
 
343
If I<yes>, then when real or failback servers are determined
 
344
to be down, they are readded to the kernel's LVS table with weight 0 if
 
345
they do not exist in the table. Setting the value to no, allows manually 
 
346
removing the realserver to manually disable all persistent connections.
341
347
 
342
348
B<cleanstop = >B<yes> | B<no>
343
349
 
749
755
            $CHECKCOUNT
750
756
            $FAILURECOUNT
751
757
            $QUIESCENT
 
758
            $READDQUIESCENT
752
759
            $FORKING
753
760
            $EMAILALERT
754
761
            $EMAILALERTFREQ
1255
1262
        $MAINTDIR         = undef;
1256
1263
        $NEGOTIATETIMEOUT = -1;
1257
1264
        $QUIESCENT        = "no";
 
1265
        $READDQUIESCENT   = "no";
1258
1266
        $SUPERVISED       = "no";
1259
1267
        $SMTP             = undef;
1260
1268
}
1697
1705
                            or &config_error($line,
1698
1706
                                        "quiescent must be 'yes' or 'no'");
1699
1707
                        $QUIESCENT = $1;
 
1708
                } elsif ($linedata  =~ /^readdquiescent\s*=\s*(.*)/) {
 
1709
                        ($1 eq "yes" || $1 eq "no")
 
1710
                            or &config_error($line,
 
1711
                                        "readdquiescent must be 'yes' or 'no'");
 
1712
                        $READDQUIESCENT = $1;
1700
1713
                } elsif  ($linedata  =~ /^emailalert\s*=\s*(.*)/) {
1701
1714
                        $EMAILALERT = read_emailalert($line, $1);
1702
1715
                } elsif  ($linedata  =~ /^emailalertfreq\s*=\s*(\d*)/) {
2458
2471
        my ($v) = (@_);
2459
2472
 
2460
2473
        if ($v->{"protocol"} eq "fwm") {
2461
 
                return &get_virtual($v) . " "  . $v->{protocol} . ($v->{addressfamily} == AF_INET6 ? "6" : "");
 
2474
                return &get_virtual($v) . " "  . $v->{protocol} . (($v->{addressfamily} == AF_INET6) ? "6" : "");
2462
2475
        }
2463
2476
        else {
2464
2477
                return &get_virtual($v) . " "  . $v->{protocol};
2530
2543
        }
2531
2544
 
2532
2545
        for my $k (keys (%$server_down)) {
2533
 
                my $v = $server_down->{$k};
 
2546
                my $v = $server_down->{$k};     
 
2547
                if ($READDQUIESCENT eq "no") {
 
2548
                        # Ensure that the server is initially added
 
2549
                        service_set(@$v[0], @$v[1], "up", {force => 1});
 
2550
                }
 
2551
                # Remove Server
2534
2552
                service_set(@$v[0], @$v[1], "down", {force => 1});
2535
2553
                delete($server_down->{$k});
2536
2554
                #sleep 5;
3839
3857
                if (defined($or)) {
3840
3858
                        &system_wrapper("$IPVSADM -e "
3841
3859
                                        . "$ipvsadm_args $rforw -w 0");
 
3860
                        &ld_log("Quiescent $log_args (Weight set to 0)");
 
3861
                        &ld_emailalert_send("Quiescent $log_args (Weight set to 0)",
 
3862
                                    $v, $rservice, $currenttime);
3842
3863
                }
3843
 
                else {
 
3864
                elsif ($READDQUIESCENT eq "yes") {
3844
3865
                        &system_wrapper("$IPVSADM -a "
3845
3866
                                        . "$ipvsadm_args $rforw -w 0");
 
3867
                        &ld_log("Readd Quiescent $log_args (Weight set to 0)");
 
3868
                        &ld_emailalert_send("Quiescent $log_args (Weight set to 0)",
 
3869
                                    $v, $rservice, $currenttime);
3846
3870
                }
3847
 
                &ld_log("Quiescent $log_args (Weight set to 0)");
3848
 
                &ld_emailalert_send("Quiescent $log_args (Weight set to 0)",
3849
 
                                    $v, $rservice, $currenttime);
3850
3871
        }
3851
3872
        else {
3852
3873
                &system_wrapper("$IPVSADM -d $ipvsadm_args");
4825
4846
        my ($v) = (@_);
4826
4847
 
4827
4848
        if ($v->{"protocol"} eq "fwm") {
4828
 
                return $v->{"protocol"} . ($v->{addressfamily} == AF_INET6?"6":"") . ":" .  &get_virtual($v);
 
4849
                return $v->{"protocol"} . (($v->{addressfamily} == AF_INET6)?"6":"") . ":" .  &get_virtual($v);
4829
4850
        }
4830
4851
        else {
4831
4852
                return $v->{"protocol"} . ":" .  &get_virtual($v);