[openldap] system resource limiting for slapd using ulimit
jvcelak
jvcelak at fedoraproject.org
Fri Mar 18 22:17:29 UTC 2011
commit 91ac19e61e3f0f383a9a0e36604261a72dd99e5d
Author: Jan Vcelak <jvcelak at redhat.com>
Date: Fri Mar 18 12:51:00 2011 +0100
system resource limiting for slapd using ulimit
ldap.init | 8 +++++++-
ldap.sysconfig | 3 +++
2 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/ldap.init b/ldap.init
index 1c2fe62..46720d6 100644
--- a/ldap.init
+++ b/ldap.init
@@ -202,9 +202,15 @@ function start() {
if test x$SLAPD_LDAPI = xyes ; then
harg="$harg ldapi:///"
fi
+ # System resources limit.
+ if [ -n "$SLAPD_ULIMIT_SETTINGS" ]; then
+ ulimit="ulimit $SLAPD_ULIMIT_SETTINGS &>/dev/null;"
+ else
+ ulimit=""
+ fi
# Start daemons.
echo -n $"Starting $prog: "
- daemon --pidfile=$pidfile --check=$prog ${slapd} -h "\"$harg\"" -u ${user} $OPTIONS $SLAPD_OPTIONS
+ daemon --pidfile=$pidfile --check=$prog $ulimit ${slapd} -h "\"$harg\"" -u ${user} $OPTIONS $SLAPD_OPTIONS
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
touch $lockfile
diff --git a/ldap.sysconfig b/ldap.sysconfig
index 56b7493..eec60cc 100644
--- a/ldap.sysconfig
+++ b/ldap.sysconfig
@@ -25,3 +25,6 @@
# Maximum allowed time to wait for slapd shutdown on 'service ldap stop' (in seconds)
#SLAPD_SHUTDOWN_TIMEOUT=3
+
+# Parameters to ulimit, use to change system limits for slapd
+#SLAPD_ULIMIT_SETTINGS=""
More information about the scm-commits
mailing list