[oe-commits] Scot Salmon : sysvinit: allow stack size configuration from rcS

git at git.openembedded.org git at git.openembedded.org
Mon Aug 11 09:56:35 UTC 2014


Module: openembedded-core.git
Branch: master-next
Commit: 0b5db16929de7668174e74e428f3e4e90e76e1d8
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=0b5db16929de7668174e74e428f3e4e90e76e1d8

Author: Scot Salmon <scot.salmon at ni.com>
Date:   Mon Aug  4 10:40:30 2014 -0500

sysvinit: allow stack size configuration from rcS

For certain swap/overcommit settings (e.g. when overcommit is disabled
on a real-time system), we need to limit the stack size used by
initscripts.  When the STACK_SIZE environment variable is set (usually
in /etc/default/rcS), ulimit the stack size to the value specified.

Make the stack size ulimit a soft limit, which allows the user to
increase the stack size where required without having to run the
respective application as root.

Signed-off-by: Scot Salmon <scot.salmon at ni.com>
Signed-off-by: Gratian Crisan <gratian.crisan at ni.com>
Signed-off-by: Ben Shelton <ben.shelton at ni.com>
Acked-by: Rich Tollerton <rich.tollerton at ni.com>
Acked-by: Brad Mouring <brad.mouring at ni.com>
Acked-by: Bill Pittman <bill.pittman at ni.com>
Signed-off-by: Saul Wold <sgw at linux.intel.com>

---

 meta/recipes-core/sysvinit/sysvinit/rc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index 1f400d9..7ca41ae 100755
--- a/meta/recipes-core/sysvinit/sysvinit/rc
+++ b/meta/recipes-core/sysvinit/sysvinit/rc
@@ -65,6 +65,9 @@ startup() {
   # Set onlcr to avoid staircase effect.
   stty onlcr 0>&1
 
+  # Limit stack size for startup scripts
+  [ "$STACK_SIZE" == "" ] || ulimit -S -s $STACK_SIZE
+
   # Now find out what the current and what the previous runlevel are.
 
   runlevel=$RUNLEVEL



More information about the Openembedded-commits mailing list