Tag: ulimit

Apache / MySql未运行。 怎么了?

我在我的Ubuntu 12.04上安装了lampp / xampp。 安装后,Apache和MySQL运行正常。 现在,他们不是。 这是我尝试运行apache时得到的结果: 命令: /etc/init.d/apache2 start 结果: * Starting web server apache2 /usr/sbin/apache2ctl: 87: ulimit: error setting limit (Operation not permitted) (13)Permission denied: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down Unable to open logs Action ‘start’ failed. The Apache error log may have more information.

nofile ulimit -n在Ubuntu 14.04 LTS上

➜ sudo sysctl -a|grep file fs.file-max = 2037581 fs.file-nr = 2784 0 2037581 ➜ ~ cat /proc/sys/fs/file-max 2037581 ➜ ~ cat /proc/sys/fs/file-nr 2720 0 2037581 在/etc/security/limits.conf * hard nofile 2037581 * soft nofile 2037581 root hard nofile 2037581 root soft nofile 2037581 /etc/pam.d/su中 session required pam_limits.so /etc/pam.d/common-session session required pam_limits.so 然后重启。 但ulimit -n再次得到1024。 只能将ulimit -n […]

如何删除核心转储文件大小的限制

我想作为普通用户增加核心转储文件的最大大小限制。 使用bash ,我可以像这样设置: $ ulimit -c 100 这在我第一次设置时效果很好。 但是,下次使用此命令时,我只能将此限制设置为不超过100的值。通常,我只能在登录后第一次使用此命令时将其设置为任意值。 在接下来的所有时间中,可能的值受到初始设定值的限制。 如何在命令的多次使用中使其持久化?

叉炸弹保护不起作用:进程数量不受限制

我刚刚意识到我的系统并没有正确限制每个用户的进程数量,因此不会阻止用户使用分叉炸弹并使整个系统崩溃: user@thebe:~$ cat /etc/security/limits.conf | grep user user hard nproc 512 user@thebe:~$ ulimit -u 1024 user@thebe:~$ :(){ :|:& };: [1] 2559 user@thebe:~$ ht-bash: fork: Cannot allocate memory -bash: fork: Cannot allocate memory -bash: fork: Cannot allocate memory -bash: fork: Cannot allocate memory -bash: fork: Cannot allocate memory -bash: fork: Cannot allocate memory -bash: fork: Cannot […]

为什么它无法为非root用户获取超过4096个最大打开文件?

尽管遵循与此问题相关的每个StackExchange答案,我似乎无法在Ubuntu 14.04上增加非root用户的nofile限制。 到目前为止我有: $ cat /etc/security/limits.d/custom.conf @www-data hard nofile 50000 @www-data soft nofile 50000 # even tried specifying the username directly: myuser hard nofile 50000 myuser soft nofile 50000 $ grep ‘limits’ /etc/pam.d/common-session* /etc/pam.d/common-session:session required pam_limits.so /etc/pam.d/common-session-noninteractive:session required pam_limits.so $ cat /proc/sys/fs/file-max 101232 重新启动,登录,并: $ ulimit -n 4097 -bash: ulimit: open files: cannot modify limit: […]

如何为特定进程设置内存限制?

我试图在384 GB RAM服务器上执行mpiexec -16 …但是它引发了OOM Killer并且被中止了。 如何为mpiexec执行设置内存限制? 我知道ulimit ,但它可能会影响其他进程。 谢谢。