[PATCH v2] ctdb-scripts: Fix tcp_tw_recycle existence check

Rafael David Tinoco rafaeldtinoco at ubuntu.com
Mon Jun 3 12:40:14 UTC 2019


net.ipv4.tcp_tw_recycle has been removed from Linux 4.12 but, still,
makes sense to check its existence. Unfortunately, current check does
not test for the procfs file existence. This commit fixes the issue.

Signed-off-by: Rafael David Tinoco <rafaeldtinoco at ubuntu.com>
---
 ctdb/config/nfs-linux-kernel-callout | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ctdb/config/nfs-linux-kernel-callout b/ctdb/config/nfs-linux-kernel-callout
index def69a04649..5625eddf6e2 100755
--- a/ctdb/config/nfs-linux-kernel-callout
+++ b/ctdb/config/nfs-linux-kernel-callout
@@ -280,10 +280,12 @@ nfs_startup ()
 {
     basic_stop "nfs" || true
     basic_start "nfs"
+
+    [ "${PROCFS_PATH}" ] || return 0
+
     _f="${PROCFS_PATH}/sys/net/ipv4/tcp_tw_recycle"
-    if [ "$_f" ] ; then
-	echo 1 >"$_f"
-    fi
+
+    [ -f "$_f" ] && echo 1 > "$_f"
 }
 
 ##################################################
-- 
2.20.1




More information about the samba-technical mailing list