diff options
author | Scot Salmon <scot.salmon@ni.com> | 2014-08-04 10:40:30 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2014-08-11 10:53:05 +0100 |
commit | 2d77fbf7e84288cdb0d93111c6eb91440597e9c3 (patch) | |
tree | 21587320df99684ceb44f776a90f47d71c8ad726 | |
parent | b32b819ec9be8e0cdd6a345a417bf7023d40412f (diff) | |
download | poky-2d77fbf7e84288cdb0d93111c6eb91440597e9c3.tar.gz |
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.
(From OE-Core rev: 0b5db16929de7668174e74e428f3e4e90e76e1d8)
Signed-off-by: Scot Salmon <scot.salmon@ni.com>
Signed-off-by: Gratian Crisan <gratian.crisan@ni.com>
Signed-off-by: Ben Shelton <ben.shelton@ni.com>
Acked-by: Rich Tollerton <rich.tollerton@ni.com>
Acked-by: Brad Mouring <brad.mouring@ni.com>
Acked-by: Bill Pittman <bill.pittman@ni.com>
Signed-off-by: Saul Wold <sgw@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rwxr-xr-x | meta/recipes-core/sysvinit/sysvinit/rc | 3 |
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() { | |||
65 | # Set onlcr to avoid staircase effect. | 65 | # Set onlcr to avoid staircase effect. |
66 | stty onlcr 0>&1 | 66 | stty onlcr 0>&1 |
67 | 67 | ||
68 | # Limit stack size for startup scripts | ||
69 | [ "$STACK_SIZE" == "" ] || ulimit -S -s $STACK_SIZE | ||
70 | |||
68 | # Now find out what the current and what the previous runlevel are. | 71 | # Now find out what the current and what the previous runlevel are. |
69 | 72 | ||
70 | runlevel=$RUNLEVEL | 73 | runlevel=$RUNLEVEL |