mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-25 04:57:03 +00:00
Warn users if the ulimit is too low and tell them what to do.
Setting ulimit in narwhal.conf isn't necessary, not all targets need a larger limit. In addition, if the hard limit is 512, it can't be set above that once the terminal session starts.
This commit is contained in:
+19
@@ -540,6 +540,25 @@ global.colorPrint = function(/* String */ message, /* String */ color)
|
||||
stream.print(colorize(message, color));
|
||||
};
|
||||
|
||||
var minUlimit = 1024;
|
||||
|
||||
global.checkUlimit = function()
|
||||
{
|
||||
var p = OS.popen(["ulimit", "-n"]);
|
||||
|
||||
if (p.wait() === 0)
|
||||
{
|
||||
var limit = p.stdout.read().split("\n")[0];
|
||||
|
||||
if (Number(limit) < minUlimit)
|
||||
{
|
||||
stream.print("\0red(\0bold(WARNING:\0)\0) Cappuccino may need to open more files than this terminal session currently allows (" + limit + "). Add the following line to your login configuration file (.bash_profile, .bashrc, etc.), start a new terminal session, then try again:\n");
|
||||
stream.print("ulimit -n " + minUlimit);
|
||||
OS.exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// built in tasks
|
||||
|
||||
|
||||
Reference in New Issue
Block a user