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

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