path: root/meta/recipes-core/sysvinit
diff options
authorScot Salmon <>2014-08-04 10:40:30 -0500
committerRichard Purdie <>2014-08-11 10:46:58 +0100
commit0b5db16929de7668174e74e428f3e4e90e76e1d8 (patch)
treeaa7c2ec2b9adb473d544e2b844fefd049fc47c0b /meta/recipes-core/sysvinit
parent0be9be4055e5b7f649d523a38344d3964dc9fdc4 (diff)
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 <> Signed-off-by: Gratian Crisan <> Signed-off-by: Ben Shelton <> Acked-by: Rich Tollerton <> Acked-by: Brad Mouring <> Acked-by: Bill Pittman <> Signed-off-by: Saul Wold <>
Diffstat (limited to 'meta/recipes-core/sysvinit')
1 files changed, 3 insertions, 0 deletions
diff --git a/meta/recipes-core/sysvinit/sysvinit/rc b/meta/recipes-core/sysvinit/sysvinit/rc
index 1f400d9e55..7ca41ae1ae 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.