In a previous mail, I reported some errors with IPv6addr assigning IPv6 to the loopback interface.<div><br></div><div>I've developed a RA that is able to manage an IPv6 in the main loopback interface of most linux systems: "lo".</div>
<div><br></div><div><br></div><div>I put here the code, but you can also found it here:</div><div><br></div><div><a href="http://pastebin.com/rsqz83V3">http://pastebin.com/rsqz83V3</a></div><div><a href="http://ral-arturo.blogspot.com/2011/10/ipv6addrlo-asignando-ipv6-interfaz-de.html">http://ral-arturo.blogspot.com/2011/10/ipv6addrlo-asignando-ipv6-interfaz-de.html</a></div>
<div><br></div><div><div>#!/bin/bash</div><div>#</div><div># OCF Resource Agent compliant resource script.</div><div>#<span class="Apple-tab-span" style="white-space:pre"> </span>Arturo Borrero <<a href="mailto:aborrero@cica.es">aborrero@cica.es</a>> || October 2011</div>
<div>#</div><div>#<span class="Apple-tab-span" style="white-space:pre"> </span>Based on the anything RA.</div><div>#</div><div>#<span class="Apple-tab-span" style="white-space:pre"> </span>GPLv3 Licensed. You can read the license in</div>
<div>#<span class="Apple-tab-span" style="white-space:pre"> </span><a href="http://www.gnu.org/licenses/gpl-3.0.html">http://www.gnu.org/licenses/gpl-3.0.html</a></div><div>#</div><div># Initialization:</div><div><br></div>
<div>: ${OCF_FUNCTIONS_DIR=${OCF_ROOT}/resource.d/heartbeat}</div><div>. ${OCF_FUNCTIONS_DIR}/.ocf-shellfuncs</div><div><br></div><div># Custom vars:</div><div>IFCONFIG_BIN="/sbin/ifconfig"</div><div>GREP_BIN="grep"</div>
<div>IFACE="lo"</div><div>process=$OCF_RESOURCE_INSTANCE</div><div>ipv6addr=$OCF_RESKEY_ipv6addr</div><div>cidr_netmask=$OCF_RESKEY_cidr_netmask</div><div>pidfile=$OCF_RESKEY_pidfile ; [ -z "$pidfile" ] && pidfile=${HA_VARRUN}IPv6addrLO_${process}.pid</div>
<div>logfile=$OCF_RESKEY_logfile ; [ -z "$logfile" ] && logfile="/var/log/syslog"</div><div>errlogfile=$OCF_RESKEY_errlogfile ; [ -z "$errlogfile" ] && errlogfile="/var/log/syslog"</div>
<div><br></div><div><br></div><div>validate_ipv6(){</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "Validating IPv6 addr: [\"$1\"]."</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>echo "$1" | $GREP_BIN -E "^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])(.(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9]?[0-9])){3}))|:)))(%.+)?\s*$" > /dev/null</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -eq 0 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># the ipv6 is valid</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "IPv6 addr: [\"$1\"] is valid."</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return 1</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># the ipv6 is invalid</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "IPv6 addr: [\"$1\"] is not valid."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return 0</div><div>}</div><div>validate_cidr(){</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "Validating cidr: \"$1\"."</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $1 -lt 129 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $1 -gt 0 ]</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># the cidr is valid</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "Cidr: \"$1\" is valid."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return 1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "Cidr: \"$1\" is not valid."</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return 0</div><div>}</div>
<div><br></div><div>iface_has_ipv6()</div><div>{</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "Checking if iface \"$IFACE\" has the ipv6 [\"$ipv6addr\"]."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ ! -z $1 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>$IFCONFIG_BIN $IFACE | $GREP_BIN $1 2> /dev/null > /dev/null</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -eq 0 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># the iface has the IPv6</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log info "The iface \"$IFACE\" has the ipv6 [\"$ipv6addr\"]."</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return 1</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log info "The iface \"$IFACE\" does not have the ipv6 [\"$ipv6addr\"]."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return 0</div><div>}</div><div><br></div><div>IPv6addrLO_status() {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># Will check that the system has the ipv6 saved in the pidfile</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ -r $pidfile ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "STATUS: The pidfile \"$pidfile\" exists."</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>validate_ipv6 `cat $pidfile | awk -F'/' '{print $1}'`</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -eq 1 ]</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># the ipv6 stored in pidfile is valid, then check if the system has that ip</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>iface_has_ipv6 `cat $pidfile`</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -eq 1 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log info "The iface \"$IFACE\" has the IPv6 \"[`cat $pidfile`]\" stored in \"$pidfile\"."</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_RUNNING</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "When checking status, the iface \"$IFACE\" has nor the IPv6 of the \"$pidfile\" nor \"$ipv6addr\"."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_ERR_GENERIC</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "The ipv6addr in \"$pidfile\" is not valid: [\"`cat $pidfile`\"]."</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_ERR_GENERIC</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "The pidfile \"$pidfile\" don't exists."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_NOT_RUNNING</div><div>}</div><div><br></div><div>IPv6addrLO_start() {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if ! IPv6addrLO_status</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># First, validate the input parameteres, ipv6addr and cidr_netmaks</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>validate_ipv6 $ipv6addr</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -ne 1 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "$process: The ipv6 addr: \"$ipv6addr\" is not a valid one."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_ERR_GENERIC</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>validate_cidr $cidr_netmask</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -ne 1 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "$process: The cidr netmask \"$cidr_netmask\" is not valid."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_ERR_GENERIC</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><br></div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span># Before assign the ip, check if we already have that ip</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span># because maybe we had a sudden reboot and the ipv6 is still on lo.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>iface_has_ipv6 $ipv6addr</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -eq 1 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># we have the IPv6addr on loopback</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log info "The iface \"$IFACE\" had the IPv6 addr [\"$ipv6addr/$cidr_netmask\"], don't assigning again."</div><div>
<span class="Apple-tab-span" style="white-space:pre"> </span>touch $pidfile</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -ne 0 ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log war "Could not create the pidfile \"$pidfile\"."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>echo "$ipv6addr/$cidr_netmask" > $pidfile</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $? -ne 0 ]</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "Failed to manage the new pidfile for \"$ipv6addr/\$cidr_netmask\"."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># we don't have the IPv6addr on loopback</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log info "Starting $process"</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span># Doing different depending on what logfile we have.</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ -n "$logfile" -a -n "$errlogfile" ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># We have logfile and errlogfile, so redirect STDOUT und STDERR to different files</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>$IFCONFIG_BIN $IFACE add $ipv6addr/$cidr_netmask >> $logfile 2>> $errlogfile</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ -n "$logfile" ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># We only have logfile so redirect STDOUT and STDERR to the same file</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>$IFCONFIG_BIN $IFACE add $ipv6addr/$cidr_netmask >> $logfile 2>&1</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span># We have neither logfile nor errlogfile, so we're not going to redirect anything</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>$IFCONFIG_BIN $IFACE add $ipv6addr/$cidr_netmask</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>echo "$ipv6addr/$cidr_netmask" > $pidfile</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span># Check what happened here.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if IPv6addrLO_status</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log info "$process: Started successfully."</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_SUCCESS</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "$process: Could not be started: ipv6addr[\"$ipv6addr\"] cidr_netmask[\"$cidr_netmask\"]."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_ERR_GENERIC</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span># If already running, consider start successful</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "$process: is already running"</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_SUCCESS</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div>}</div><div><br></div><div>IPv6addrLO_stop() {</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "$process: Running STOP function."</div><div><br></div><div> if [ -n "$OCF_RESKEY_stop_timeout" ]</div>
<div> then</div><div> stop_timeout=$OCF_RESKEY_stop_timeout</div><div> elif [ -n "$OCF_RESKEY_CRM_meta_timeout" ]; then</div><div> # Allow 2/3 of the action timeout for the orderly shutdown</div>
<div> # (The origin unit is ms, hence the conversion)</div><div> stop_timeout=$((OCF_RESKEY_CRM_meta_timeout/1500))</div><div> else</div><div> stop_timeout=10</div><div>
fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if IPv6addrLO_status</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>$IFCONFIG_BIN $IFACE del `cat $pidfile`</div>
<div> i=0</div><div> while [ $i -lt $stop_timeout ]</div><div> do</div><div> if ! IPv6addrLO_status</div><div> then</div><div> <span class="Apple-tab-span" style="white-space:pre"> </span>rm -f $pidfile</div>
<div> return $OCF_SUCCESS</div><div> fi</div><div> sleep 1</div><div> i=`expr $i + 1`</div><div> done</div>
<div> ocf_log warn "Stop failed. Trying again."</div><div> $IFCONFIG_BIN $IFACE del `cat $pidfile`</div><div> rm -f $pidfile</div><div> if ! IPv6addrLO_status</div>
<div> then</div><div> ocf_log warn "Stop success."</div><div> return $OCF_SUCCESS</div><div> else</div><div> ocf_log err "Failed to stop."</div>
<div> return $OCF_ERR_GENERIC</div><div> fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div><div><span class="Apple-tab-span" style="white-space:pre"> </span># was not running, so stop can be considered successful</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>$ICONFIG_BIN $IFACE del `cat $pidfile`</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>rm -f $pidfile</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_SUCCESS</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div>}</div><div><br></div><div>IPv6addrLO_monitor() {</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>IPv6addrLO_status</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>ret=$?</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ $ret -eq $OCF_SUCCESS ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ -n "$OCF_RESKEY_monitor_hook" ]; then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>eval "$OCF_RESKEY_monitor_hook"</div>
<div> if [ $? -ne $OCF_SUCCESS ]; then</div><div> return ${OCF_ERR_GENERIC}</div><div> fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_SUCCESS</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>true</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>return $ret</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div>
<div>}</div><div><br></div><div><br></div><div>IPv6addrLO_validate() {</div><div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "IPv6addrLO validating: args:[\"$*\"]"</div>
<div><br></div><div><span class="Apple-tab-span" style="white-space:pre"> </span>if [ -x $IFCONFIG_BIN ]</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>then</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log debug "Binary \"$IFCONFIG_BIN\" exist and is executable."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_SUCCESS</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>else</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "Binary \"$IFCONFIG_BIN\" does not exist or isn't executable."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_ERR_INSTALLED</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>fi</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "Error while validating."</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>return $OCF_ERR_GENERIC</div><div>}</div><div><br></div><div>IPv6addrLO_meta(){</div><div>cat <<END</div><div><?xml version="1.0"?></div>
<div><!DOCTYPE resource-agent SYSTEM "ra-api-1.dtd"></div><div><resource-agent name="IPv6addrLO"></div><div><version>0.1</version></div><div><longdesc lang="en"></div>
<div>OCF RA to manage IPv6addr on loopback interface Linux</div><div></longdesc></div><div><shortdesc lang="en">IPv6 addr on loopback linux</shortdesc></div><div><br></div><div><parameters></div>
<div><parameter name="ipv6addr" required="1"></div><div><longdesc lang="en"></div><div>The ipv6 addr to asign to the loopback interface.</div><div></longdesc></div><div><shortdesc lang="en">Ipv6 addr to the loopback interface.</shortdesc></div>
<div><content type="string" default=""/></div><div></parameter></div><div><parameter name="cidr_netmask" required="1"></div><div><longdesc lang="en"></div>
<div>The cidr netmask of the ipv6 addr.</div><div></longdesc></div><div><shortdesc lang="en">netmask of the ipv6 addr.</shortdesc></div><div><content type="string" default="128"/></div>
<div></parameter></div><div><parameter name="logfile" required="0"></div><div><longdesc lang="en"></div><div>File to write STDOUT to</div><div></longdesc></div><div><shortdesc lang="en">File to write STDOUT to</shortdesc></div>
<div><content type="string" /></div><div></parameter></div><div><parameter name="errlogfile" required="0"></div><div><longdesc lang="en"></div><div>File to write STDERR to</div>
<div></longdesc></div><div><shortdesc lang="en">File to write STDERR to</shortdesc></div><div><content type="string" /></div><div></parameter></div><div></parameters></div>
<div><actions></div><div><action name="start" timeout="20s" /></div><div><action name="stop" timeout="20s" /></div><div><action name="monitor" depth="0" timeout="20s" interval="10" /></div>
<div><action name="meta-data" timeout="5" /></div><div><action name="validate-all" timeout="5" /></div><div></actions></div><div></resource-agent></div><div>
END</div><div>exit 0</div><div>}</div><div><br></div><div>case "$1" in</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>meta-data|metadata|meta_data|meta)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>IPv6addrLO_meta</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>;;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>start)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>IPv6addrLO_start</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>;;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>stop)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>IPv6addrLO_stop</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>;;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>monitor)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>IPv6addrLO_monitor</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>;;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>validate-all)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>IPv6addrLO_validate</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>;;</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>*)</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>ocf_log err "$0 was called with unsupported arguments:"</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>exit $OCF_ERR_UNIMPLEMENTED</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>;;</div><div>esac</div><div><br></div>-- <br>/* Arturo Borrero Gonzalez || <a href="mailto:cer.inet@linuxmail.org" target="_blank">cer.inet@linuxmail.org</a> */<br>
/* Use debian gnu/linux! Best OS ever! */<br><br>
</div>