Blame SOURCES/bz1732867-CTDB-2-add-ctdb_max_open_files-parameter.patch

a89620
From 61f7cb5954d1727f58fab6d642a124ef342c8641 Mon Sep 17 00:00:00 2001
a89620
From: Oyvind Albrigtsen <oalbrigt@redhat.com>
a89620
Date: Wed, 20 Feb 2019 11:24:28 +0100
a89620
Subject: [PATCH] CTDB: add ctdb_max_open_files parameter
a89620
a89620
---
a89620
 heartbeat/CTDB.in | 13 +++++++++++++
a89620
 1 file changed, 13 insertions(+)
a89620
a89620
diff --git a/heartbeat/CTDB.in b/heartbeat/CTDB.in
a89620
index 0d58c850a..bbf8ef627 100755
a89620
--- a/heartbeat/CTDB.in
a89620
+++ b/heartbeat/CTDB.in
a89620
@@ -288,6 +288,14 @@ What debug level to run at (0-10). Higher means more verbose.
a89620
 <content type="integer" default="2" />
a89620
 </parameter>
a89620
 
a89620
+<parameter name="ctdb_max_open_files" required="0">
a89620
+<longdesc lang="en">
a89620
+Maximum number of open files (for ulimit -n)
a89620
+</longdesc>
a89620
+<shortdesc lang="en">Max open files</shortdesc>
a89620
+<content type="integer" default="" />
a89620
+</parameter>
a89620
+
a89620
 <parameter name="smb_conf" unique="0" required="0">
a89620
 <longdesc lang="en">
a89620
 Path to default samba config file.  Only necessary if CTDB
a89620
@@ -611,6 +619,11 @@ ctdb_start() {
a89620
 	start_as_disabled="--start-as-disabled"
a89620
 	ocf_is_true "$OCF_RESKEY_ctdb_start_as_disabled" || start_as_disabled=""
a89620
 
a89620
+	# set nofile ulimit for ctdbd process
a89620
+	if [ -n "$OCF_RESKEY_ctdb_max_open_files" ]; then
a89620
+		ulimit -n "$OCF_RESKEY_ctdb_max_open_files"
a89620
+	fi
a89620
+
a89620
 	# Start her up
a89620
 	"$OCF_RESKEY_ctdbd_binary" \
a89620
 		--reclock="$OCF_RESKEY_ctdb_recovery_lock" \