--- ./ctdb/config/ctdbd_wrapper_orig	2017-09-14 14:54:38 +0530
+++ ./ctdb/config/ctdbd_wrapper	2017-09-14 15:06:55 +0530
@@ -8,6 +8,12 @@
     exit 1
 }
 
+if [ "$(uname)" == "AIX" ]; then
+pkill(){
+   kill "$1" `ps -ef | grep "$3" | grep -v grep | /usr/bin/awk '{print $2}'`
+}
+fi
+
 [ $# -eq 2 ] || usage
 
 pidfile="$1"
@@ -255,7 +261,7 @@
     return 1
 }
 
-stop()
+stop2()
 {
     if ! _session=$(ctdbd_is_running) ; then
 	echo "CTDB is not running"
@@ -306,7 +312,7 @@
 
 case "$action" in
     start) start ;;
-    stop)  stop  ;;
+    stop)  stop2 ;;
     *)
 	echo "usage: $0 {start|stop}"
 	exit 1
--- ./ctdb/config/functions_orig	2017-09-14 16:58:31 +0530
+++ ./ctdb/config/functions	2017-09-20 20:53:53 +0530
@@ -29,6 +29,19 @@
     CTDB_HELPER_BINDIR="/usr/local/libexec/ctdb"
 fi
 
+if [ "$(uname)" == "AIX" ]; then
+killall(){
+    args=''
+    for var in "$@"; do
+       [ "$var" != '-q' ] && args="$args $var"
+    done
+    kill_proc $args 2>/dev/null
+}
+kill_proc(){
+   kill "$1" `ps -ef | grep -w "$2" | grep -v grep | /usr/bin/awk '{print $2}'`
+}
+fi
+
 #######################################
 # pull in a system config file, if any
 
@@ -238,7 +251,7 @@
 # simulate /sbin/service (niced) on platforms that don't have it
 nice_service()
 {
-    _nice="nice"
+    _nice="/usr/bin/nice"
     _service "$@"
 }
 
@@ -401,7 +414,7 @@
 
 		return 1
 		;;
-	    98)
+	    98|67)
 		# Couldn't bind, something already listening, next port...
 		continue
 		;;
