LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: ipvsadm version mismatch in debian

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: ipvsadm version mismatch in debian
Cc: Joerg Wendland <joergland@xxxxxxxxxx>
From: Horms <horms@xxxxxxxxxxxx>
Date: Mon, 18 Oct 2004 15:42:13 +0900
On Sun, Oct 17, 2004 at 09:55:40PM +0200, Roberto Nibali wrote:

[snip]

> >I'd prefer a wrapper script which automatically executes the right 
> >binary depending on your running kernel version. It's a simple thing, 
> >if I don't receive any further response from the Debian Maintainer of 
> >ipvsadm (shameless plug: I opened the above bug report) I might just 
> >write one myself and see if it gets accepted.
> 
> Something like this should easily solve the problem, no?

Yes, I agree. Something like this in conjunction with a diversion
(debian packaging speak for different packages can provide the same
binary) should work well. I have CCed the maintainer for his
consideration.

An alternate solution would be to have the 2.6 ipvsadm binary
try to execute ipvsadm.old if it detects a 2.4 kernel is running.
This is basically the way that modprobe and friends handle the same
problem of incompatible interfaces between different kernel versions.

> --- ipvsadm-orig        2004-10-17 21:46:12.000000000 +0200
> +++ ipvsadm     2004-10-17 21:51:53.000000000 +0200
> @@ -1,6 +1,30 @@
>  #!/bin/sh
> 
> -IPVSADM="/sbin/ipvsadm"
> +declare -ri EOK=0
> +declare -ri ENOEXIST=1
> +
> +: ${KERNEL_VERSION:=$(uname -r)}
> +IPVSADM="/sbin/ipvsadm-${KERNEL_VERSION:0:3}"
> +
> +case ${KERNEL_VERSION} in
> +    2.2*)
> +       :
> +       ;;
> +    2.4*)
> +       :
> +       ;;
> +    2.6*)
> +       :
> +       ;;
> +    *)
> +       IPVSADM="/sbin/ipvsadm-${KERNEL_VERSION}"
> +       ;;
> +esac
> + 
>        if [ ! -f "${IPVSADM}" ]; then
> +       echo "${IPVSADM} does not exist"
> +       exit ${ENOEXIST}
> +fi
> +
>  IPVSADM_RULES="/etc/ipvsadm.rules"
>  IPVSADM_CONFIG="/etc/default/ipvsadm"
> 
> @@ -30,7 +54,7 @@
> 
>  flush () {
>      echo -n "Clearing the current IPVS table: "
> -    ipvsadm -C
> +    ${IPVSADM} -C
>      echo "Done."
>  }
> 
> @@ -94,10 +118,10 @@
>         fi
>         ;;
>      status)
> -       ipvsadm -L -n
> +       ${IPVSADM} -L -n
>         ;;
>      rate)
> -       ipvsadm -L --rate -n
> +       ${IPVSADM} -L --rate -n
>         ;;
>      load)
>         flush
> 
> Get the Debian maintainer for this package to fix at least the stuff 
> I've fixed in this patch ;).

[snip]

-- 
Horms
<Prev in Thread] Current Thread [Next in Thread>