From mboxrd@z Thu Jan 1 00:00:00 1970 From: lhh@sourceware.org Date: 2 May 2007 18:28:53 -0000 Subject: [Cluster-devel] cluster/rgmanager/src/resources ip.sh service.sh Message-ID: <20070502182853.16488.qmail@sourceware.org> List-Id: To: cluster-devel.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit CVSROOT: /cvs/cluster Module name: cluster Branch: RHEL5 Changes by: lhh at sourceware.org 2007-05-02 18:28:52 Modified files: rgmanager/src/resources: ip.sh service.sh Log message: Undo incorrectly committed changes to ip.sh and service.sh Patches: http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/ip.sh.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.21.2.2&r2=1.21.2.3 http://sourceware.org/cgi-bin/cvsweb.cgi/cluster/rgmanager/src/resources/service.sh.diff?cvsroot=cluster&only_with_tag=RHEL5&r1=1.7.2.3&r2=1.7.2.4 --- cluster/rgmanager/src/resources/ip.sh 2007/05/02 18:26:26 1.21.2.2 +++ cluster/rgmanager/src/resources/ip.sh 2007/05/02 18:28:52 1.21.2.3 @@ -86,21 +86,6 @@ - - - If set, forces the use of the specified ethernet - device for IP address assignment. Usually, - an interface is picked which has an IP in the - same subnet as the specified IP address. - - - - Ethernet device - - - - - Enabling this causes the status check to fail if @@ -412,7 +397,7 @@ { declare idx dev ifaddr declare ifaddr_exp - + while read idx dev ifaddr; do isSlave $dev @@ -428,11 +413,6 @@ done < <(/sbin/ip -o -f inet6 addr | awk '{print $1,$2,$4}') - if [ -n "$OCF_RESKEY_ethernet_device" ]; then - ip_list_interfaces - return $? - fi - return 0 } @@ -599,25 +579,6 @@ } -# -# When a user wants to use a specific device, just list all -# devices to make sure the device exists on the system -# -ip_list_interfaces() -{ - while read idx dev; do - dev=${dev/:/} - - isSlave $dev - if [ $? -ne 2 ]; then - continue - fi - - echo $dev none none - done < <(/sbin/ip -o -f link addr | awk '{print $1,$2}') -} - - ipv4_list_interfaces() { declare idx dev ifaddr @@ -629,15 +590,12 @@ continue fi + idx=${idx/:/} + echo $dev ${ifaddr/\/*/} ${ifaddr/*\//} done < <(/sbin/ip -o -f inet addr | awk '{print $1,$2,$4}') - - if [ -n "$OCF_RESKEY_ethernet_device" ]; then - ip_list_interfaces - return $? - fi - + return 0 } @@ -656,30 +614,19 @@ continue fi - if [ -n "$OCF_RESKEY_ethernet_device" ] && \ - [ "$dev" != "$OCF_RESKEY_ethernet_device" ]; then - continue - fi - if [ "$1" = "add" ]; then - if [ -z "$OCF_RESKEY_ethernet_device" ]; then - ipv6_same_subnet $ifaddr/$maskbits $addr - if [ $? -ne 0 ]; then - continue - fi - fi - + ipv6_same_subnet $ifaddr_exp/$maskbits $addr_exp + if [ $? -ne 0 ]; then + continue + fi interface_up $dev if [ $? -ne 0 ]; then continue fi - - if [ "$monitor_link" = "yes" ]; then - network_link_up $dev - if [ $? -ne 0 ]; then - continue - fi - fi + network_link_up $dev + if [ $? -ne 0 ]; then + continue + fi ocf_log info "Adding IPv6 address $addr to $dev" fi if [ "$1" = "del" ]; then @@ -725,51 +672,30 @@ ipv4() { declare dev ifaddr maskbits - declare op=$1 declare addr=$2 - declare monitor_link=$3 while read dev ifaddr maskbits; do if [ -z "$dev" ]; then continue fi - if [ -n "$OCF_RESKEY_ethernet_device" ] && \ - [ "$dev" != "$OCF_RESKEY_ethernet_device" ]; then - continue - fi - - if [ "$op" = "add" ]; then - if [ -z "$OCF_RESKEY_ethernet_device" ]; then - ipv4_same_subnet $ifaddr/$maskbits $addr - if [ $? -ne 0 ]; then - continue - fi + if [ "$1" = "add" ]; then + ipv4_same_subnet $ifaddr/$maskbits $addr + if [ $? -ne 0 ]; then + continue fi - interface_up $dev if [ $? -ne 0 ]; then - ocf_log warn "Enabling $dev" - /sbin/ip link $dev up - interface_up $dev - if [ $? -ne 0 ]; then - ocf_log warn "Failed to enable $dev" - continue - fi + continue fi - - if [ "$monitor_link" = "yes" ]; then - network_link_up $dev - if [ $? -ne 0 ]; then - continue - fi + network_link_up $dev + if [ $? -ne 0 ]; then + continue fi ocf_log info "Adding IPv4 address $addr to $dev" fi - - if [ "$op" = "del" ]; then + if [ "$1" = "del" ]; then if [ "${addr/\/*/}" != "$ifaddr" ]; then - echo "${addr/\/*/} != $ifaddr" continue fi ocf_log info "Removing IPv4 address $addr from $dev" @@ -915,11 +841,11 @@ case $1 in inet) - ipv4 $2 $3 $monitor_link + ipv4 $2 $3 return $? ;; inet6) - ipv6 $2 $3 $monitor_link + ipv6 $2 $3 return $? ;; esac @@ -941,11 +867,6 @@ ;; esac -if [ -n "$OCF_RESKEY_ethernet_device" ]; then - ocf_log debug "Forcing use of $OCF_RESKEY_ethernet_device" -else - ocf_log debug "Using default autoplacement of IP addresses" -fi if [ -z "$OCF_CHECK_LEVEL" ]; then OCF_CHECK_LEVEL=0 --- cluster/rgmanager/src/resources/service.sh 2007/05/02 18:26:26 1.7.2.3 +++ cluster/rgmanager/src/resources/service.sh 2007/05/02 18:28:52 1.7.2.4 @@ -172,16 +172,17 @@ - - - - + + + + + - + - - - + + + EOT