Commit cf1b0c1a authored by Bernard Spil's avatar Bernard Spil Committed by Nirbhay Choubey

Implement native/base process checks for FreeBSD

  - Make rsync process checks OS-dependent
  - Use (BSD) netstat on FreeBSD (not lsof)
parent f16ead51
......@@ -63,6 +63,14 @@ check_pid_and_port()
local rsync_addr=$3
local rsync_port=$4
case $OS in
FreeBSD)
local port_info=$(netstat -46lp ${rsync_port} 2>/dev/null | \
grep ":${rsync_port}")
local is_rsync=$(echo $port_info | \
grep -w '[[:space:]]\+rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null)
;;
*)
if ! which lsof > /dev/null; then
wsrep_log_error "lsof tool not found in PATH! Make sure you have it installed."
exit 2 # ENOENT
......@@ -76,6 +84,8 @@ check_pid_and_port()
grep "$rsync_addr:$rsync_port" 2>/dev/null)
local is_rsync=$(echo $port_info | \
grep -w '^rsync[[:space:]]\+'"$rsync_pid" 2>/dev/null)
;;
esac
if [ ! -z "$is_listening_all" -o ! -z "$is_listening_addr" ]; then
if [ -z "$is_rsync" ]; then
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment