[Debian-ha-maintainers] debian patches for resource-agents portblock and ganesha_mon

Jim At Your Service jimays at theidsp.net
Wed Apr 24 20:06:13 BST 2024


GREETINGS DEBIAN HA MAINTAINERS, 

Reviewing my previous mail, I could see I submitted code that would
function on Debian and no longer on Red Hat.
Here is some code that can function on both, although I do not have
access to a Red Hat environment for testing.
You may also see there is a patch for handling that tcp_tw_recycle has
been removed as of Linux 4.12,
since that was also showing errors in my Debian 12 environment. 

THANKS AGAIN FOR THE BEST DISK DRIVE WE EVER HAVE HAD ->
PACEMAKER/COROSYNC WITH NFS-GANESHA OVER GLUSTERFS OVER ZFS. 

JIM 

UPDATED PATCHES: 

VI /USR/LIB/OCF/RESOURCE.D/HEARTBEAT/GANESHA_MON 

ganesha_mon_monitor()
{
        # 13.0.11.7.10-t6 jimays debian
        local pid_file="/var/run/ganesha.pid"
        if [ "$(ls /etc/debian_version 2>/dev/null)" != "" ]; then
                pid_file="/run/ganesha/ganesha.pid"
        fi
        # ...

vi /usr/lib/ocf/resource.d/heartbeat/portblock

active_grep_pat()
{
  # 13.0.11.9.2-t12 jimays gratitude to chat gpt...
  # "In Red Hat-based distributions like CentOS and Fedora, the iptables
-n -L command displays the protocol
  #  as names like tcp, udp, or icmp, representing TCP, UDP, and ICMP
protocols respectively.
  #  However, in Debian-based distributions like Debian itself and
Ubuntu, the iptables -n -L command displays
  #  the protocol as numbers. For example, 6 represents TCP, 17
represents UDP, and 1 represents ICMP."
  if [ "$(ls /etc/debian_version 2>/dev/null)" != "" ]; then
    if [ "$1" = "tcp" ]; then
      prot=6
    elif [ "$1" = "udp" ]; then
      prot=17
    else
      prot=x
    fi
  else
    prot="$1"
  fi
  w="[  ][      ]*"
  any="0\\.0\\.0\\.0/0"
  src=$any dst=$3
  if [ "$4" = "s" ]; then
    local src=$3
    local dst=$any
  fi
  # echo
"^DROP${w}${1}${w}--${w}${src}${w}${dst}${w}multiport${w}${4}ports${w}${2}$"
  echo
"^DROP${w}${prot}${w}--${w}${src}${w}${dst}${w}multiport${w}${4}ports${w}${2}$"
}

tickle_remote()
{ 
        [ -z "$OCF_RESKEY_tickle_dir" ] && return
        # 13.0.11.9.1-t11 jimays "NOTE: net.ipv4.tcp_tw_recycle has been
removed from Linux in 4.12."
        # gratitude
https://stackoverflow.com/questions/6426253/tcp-tw-reuse-vs-tcp-tw-recycle-which-to-use-or-both
        # gratitude
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4396e46187ca5070219b81773c4e65088dac50cc
        if [ "$(ls /proc/sys/net/ipv4/tcp_tw_recycle 2>/dev/null)" != ""
]; then
                echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle
        fi
        # ...

END OF PATCHES
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-ha-maintainers/attachments/20240424/af4c67a3/attachment.htm>


More information about the Debian-ha-maintainers mailing list