From ceeb0793906263dbb0af4653fce9d960fc5091ab Mon Sep 17 00:00:00 2001 From: Bill Nottingham Date: Mon, 3 Oct 2005 21:38:03 +0000 Subject: make sure corefile limiting works for user processes as well (#166511, ) --- rc.d/init.d/functions | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rc.d/init.d/functions b/rc.d/init.d/functions index 660b4912..bf66d1ee 100755 --- a/rc.d/init.d/functions +++ b/rc.d/init.d/functions @@ -135,7 +135,7 @@ daemon() { [ -n "${pid:-}" -a -z "${force:-}" ] && return # make sure it doesn't core dump anywhere unless requested - ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0} >/dev/null 2>&1 + corelimit="ulimit -S -c ${DAEMON_COREFILE_LIMIT:-0}" # if they set NICELEVEL in /etc/sysconfig/foo, honor it [ -n "$NICELEVEL" ] && nice="nice -n $NICELEVEL" @@ -145,9 +145,9 @@ daemon() { # And start it up. if [ -z "$user" ]; then - $nice /bin/bash -c "$*" + $nice /bin/bash -c "$corelimit >/dev/null 2>&1 ; $*" else - $nice runuser -s /bin/bash - $user -c "$*" + $nice runuser -s /bin/bash - $user -c "$corelimit >/dev/null 2>&1 ; $*" fi [ "$?" -eq 0 ] && success $"$base startup" || failure $"$base startup" } -- cgit v1.2.1