--- orig/ipvsadm.8 +++ mod/ipvsadm.8 @@ -314,12 +314,9 @@ .B -w, --weight \fIweight\fP \fIWeight\fP is an integer specifying the capacity of a server relative to the others in the pool. The valid values of \fIweight\fP -are 0 through to 65535. The default is 1. Quiescent servers are -specified with a weight of zero. A quiescent server will receive no -new jobs but still serve the existing jobs, for all scheduling -algorithms distributed with the Linux Virtual Server. Setting a -quiescent server may be useful if the server is overloaded or needs to -be taken out of service for maintenance. +are 0 through to 65535. The default is 1. If the weight is 0 the server is +marked as quiecent, for more information on this see the \fIquiescent\fP +option for more details. .TP .B -x, --u-threshold \fIuthreshold\fP \fIuthreshold\fP is an integer specifying the upper connection @@ -340,6 +337,26 @@ will receive new connections when the number of its connections drops below three forth of its upper connection threshold. .TP +.B --quiescent +Marks a destination as quiescent. A quiescent server will receive no new +jobs but still serve the existing jobs, for all scheduling algorithms +distributed with the Linux Virtual Server. Setting a quiescent server may +be useful if the server is overloaded or needs to be taken out of service +for maintenance. +.sp +This flag is automatically set if the weight of a destination is set to +zero. It is overriden by \fIoffline\fP. +.TP +.B --offline +Marks a destination as offline. When offline a destination +will not accept any new connections, and all existing +connections wil be closed. This is as if the destination +was deleted, but allows offline servers to be viewed +along their online and quiescent counterparts in the +lvs services table. +.sp +This flag overrides \fIquiescent\fP. +.TP .B --mcast-interface \fIinterface\fP Specify the multicast interface that the sync master daemon sends outgoing multicasts through, or the sync backup daemon listens to for @@ -387,6 +404,13 @@ connection is used to forward the actual connections from the same client/network to the same server. .TP +.B --connflags +When used in conjunction with \fIlist\fP, +output information on the flags associated with destinations. +The flags are O if the destination is marked as offline +and Q if it is quiescent. See the \fIoffline\fP and \fIquiescent\fP +options for more information +.TP .B --sort Sort the list of virtual services and real servers. The virtual service entries are sorted in ascending order by dest.conn_flags = 0; + context = poptGetContext("ipvsadm", argc, (const char **)argv, options_table, 0); @@ -518,21 +535,23 @@ break; case 'i': set_option(options, OPT_FORWARD); - ce->dest.conn_flags = IP_VS_CONN_F_TUNNEL; + ce->dest.conn_flags |= IP_VS_CONN_F_TUNNEL; break; case 'g': set_option(options, OPT_FORWARD); - ce->dest.conn_flags = IP_VS_CONN_F_DROUTE; + ce->dest.conn_flags |= IP_VS_CONN_F_DROUTE; break; case 'm': set_option(options, OPT_FORWARD); - ce->dest.conn_flags = IP_VS_CONN_F_MASQ; + ce->dest.conn_flags |= IP_VS_CONN_F_MASQ; break; case 'w': set_option(options, OPT_WEIGHT); if ((ce->dest.weight = string_to_number(optarg, 0, 65535)) == -1) fail(2, "illegal weight specified"); + if (!ce->dest.weight) + ce->dest.conn_flags |= IP_VS_CONN_F_QUIESCENT; break; case 'x': set_option(options, OPT_UTHRESHOLD); @@ -590,6 +609,18 @@ set_option(options, OPT_SORT); *format |= FMT_SORT; break; + case IDX_DESTFLAGS: + set_option(options, OPT_DESTFLAGS); + *format |= FMT_DESTFLAGS; + break; + case IDX_QUIESCENT: + set_option(options, OPT_QUIESCENT); + ce->dest.conn_flags |= IP_VS_CONN_F_QUIESCENT; + break; + case IDX_OFFLINE: + set_option(options, OPT_OFFLINE); + ce->dest.conn_flags |= IP_VS_CONN_F_OFFLINE; + break; default: fail(2, "invalid option `%s'", poptBadOption(context, POPT_BADOPTION_NOALIAS)); @@ -678,6 +709,9 @@ {"thresholds", 0, 0, '9'}, {"persistent-conn", 0, 0, 'P'}, {"sort", 0, 0, '0'}, + {"quiescent", 0, 0, IDX_QUIESCENT}, + {"offline", 0, 0, IDX_OFFLINE}, + {"destflags", 0, 0, IDX_DESTFLAGS}, {"help", 0, 0, 'h'}, {0, 0, 0, 0} }; @@ -688,6 +722,8 @@ optind = 1; + ce->dest.conn_flags = 0; + if ((c = getopt_long(argc, argv, optstring, long_options, NULL)) == EOF) tryhelp_exit(argv[0], -1); @@ -830,21 +866,23 @@ break; case 'i': set_option(options, OPT_FORWARD); - ce->dest.conn_flags = IP_VS_CONN_F_TUNNEL; + ce->dest.conn_flags |= IP_VS_CONN_F_TUNNEL; break; case 'g': set_option(options, OPT_FORWARD); - ce->dest.conn_flags = IP_VS_CONN_F_DROUTE; + ce->dest.conn_flags |= IP_VS_CONN_F_DROUTE; break; case 'm': set_option(options, OPT_FORWARD); - ce->dest.conn_flags = IP_VS_CONN_F_MASQ; + ce->dest.conn_flags |= IP_VS_CONN_F_MASQ; break; case 'w': set_option(options, OPT_WEIGHT); if ((ce->dest.weight = string_to_number(optarg, 0, 65535)) == -1) fail(2, "illegal weight specified"); + if (!ce->dest.weight) + ce->dest.conn_flags |= IP_VS_CONN_F_QUIESCENT; break; case 'x': set_option(options, OPT_UTHRESHOLD); @@ -902,6 +940,18 @@ set_option(options, OPT_SORT); *format |= FMT_SORT; break; + case IDX_DESTFLAGS: + set_option(options, OPT_DESTFLAGS); + *format |= FMT_DESTFLAGS; + break; + case IDX_QUIESCENT: + set_option(options, OPT_QUIESCENT); + ce->dest.conn_flags |= IP_VS_CONN_F_QUIESCENT; + break; + case IDX_OFFLINE: + set_option(options, OPT_OFFLINE); + ce->dest.conn_flags |= IP_VS_CONN_F_OFFLINE; + break; default: fail(2, "invalid option `%s'", argv[optind-1]); } @@ -1318,6 +1368,8 @@ " --weight -w weight capacity of real server\n" " --u-threshold -x uthreshold upper threshold of connections\n" " --l-threshold -y lthreshold lower threshold of connections\n" + " --quiescent mark the destination as quiescent\n" + " --offline mark the destination as offline\n" " --mcast-interface interface multicast interface for connection sync\n" " --syncid sid syncid for connection sync (default=255)\n" " --connection -c output of current IPVS connections\n" @@ -1327,6 +1379,7 @@ " --rate output of rate information\n" " --thresholds output of thresholds information\n" " --persistent-conn output of persistent connection info\n" + " --destflags output of destination flags\n" " --sort sorting output of service/server entries\n" " --numeric -n numeric output of addresses and ports\n", DEF_SCHED); @@ -1576,6 +1629,11 @@ " -> RemoteAddress:Port\n", "Prot LocalAddress:Port", "Weight", "PersistConn", "ActiveConn", "InActConn"); + else if (format & FMT_DESTFLAGS) + printf("%-33s %-9s %-8s %-10s %-10s\n" + " -> RemoteAddress:Port\n", + "Prot LocalAddress:Port", + "Flags", "Weight", "ActiveConn", "InActConn"); else if (!(format & FMT_RULE)) printf("Prot LocalAddress:Port Scheduler Flags\n" " -> RemoteAddress:Port Forward Weight ActiveConn InActConn\n"); @@ -1673,8 +1731,12 @@ dname[28] = '\0'; if (format & FMT_RULE) { - printf("-a %s -r %s %s -w %d\n", svc_name, dname, - fwd_switch(e->conn_flags), e->weight); + printf("-a %s -r %s %s -w %d%s%s\n", svc_name, dname, + fwd_switch(e->conn_flags), e->weight, + (e->conn_flags & IP_VS_CONN_F_QUIESCENT)? + " --quiescent":"", + (e->conn_flags & IP_VS_CONN_F_OFFLINE)? + " --offline":""); } else if (format & FMT_STATS) { printf(" -> %-28s", dname); print_largenum(e->stats.conns); @@ -1695,6 +1757,13 @@ printf(" -> %-28s %-10u %-10u %-10u %-10u\n", dname, e->u_threshold, e->l_threshold, e->activeconns, e->inactconns); + } else if (format & FMT_DESTFLAGS) { + printf(" -> %-28s %c%c %-9u %-10u %-10u\n", + dname, + (e->conn_flags & IP_VS_CONN_F_QUIESCENT)?'Q':' ', + (e->conn_flags & IP_VS_CONN_F_OFFLINE)?'O':' ', + e->weight, + e->activeconns, e->inactconns); } else if (format & FMT_PERSISTENTCONN) { printf(" -> %-28s %-9u %-11u %-10u %-10u\n", dname, e->weight, e->persistconns,