ulimit 不生效
ulimit is a shell builtin like cd, not a separate program. sudo looks for a binary to run, but there is no ulimit binary, which is why you get the error message. You need to run it in a shell.
However, while you do need to be root to raise the limit to 65535, you probably don’t want to run your program as root. So after you raise the limit you should switch back to the current user.
To do this, run:
sudo sh -c "ulimit -n 65535 && exec su $LOGNAME"
and you will get a new shell, without root privileges, but with the raised limit. The exec causes the new shell to replace the process with sudo privileges, so after you exit that shell, you won’t accidentally end up as root again.
https://stackoverflow.com/questions/17483723/command-not-found-when-using-sudo-ulimit
ulimit 不生效的更多相关文章
- CentOS 7设置ulimit不生效的问题解决
sed -i 's/#UseLogin no/UseLogin yes/g' /etc/ssh/sshd_configservice sshd restart 重新登录后查看效果: ulimit -n ...
- 第3期:Too many open files以及ulimit的探讨
第3期:Too many open files以及ulimit的探讨 毛帅 Java.AI.互联网.金融 10 人赞同了该文章 Too many open files是Java常见的异常,通常是由于系 ...
- 设置ulimit值(Linux文件句柄数量)永久生效
Linux 默认打开文件数linux 默认打开文件数为1024个,通过ulimit -a 可以查看open files修改这个限制可以使用ulimt -SHn 65536永久生效需要进行下面设置:1. ...
- linux设置ulimit值永久生效
小知识的积累,转自 http://hi.baidu.com/moonelf9989/blog/item/1deadf12780fa0c5c2fd789d.html linux 默认打开文件数linux ...
- Centos 7 中的ulimit -n 65535 对进程的文件句柄限制不生效??
今日闲来无事,就看群里大佬吹牛逼了,偶然一条技术疑问提出来了,神奇啊,作为广大老司机技术交流群体竟然还有这么深入的研究? 大佬问:这个文件句柄限制怎么设置了/etc/security/limits.c ...
- [Linux] 关于Centos6中ulimit nproc用户进程数的限制
一.缘由: 在启动mongodb的时候,有Warning提示soft rlimits too low,就是用户使用进程数过小,遂调高系统资源关于用户最大进程数的限制ulimit -u. 先暂时使设置生 ...
- [转]正确配置Linux系统ulimit值的方法
在Linux下面部署应用的时候,有时候会遇上Socket/File: Can't open so many files的问题:这个值也会影响服务器的最大并发数,其实Linux是有文件句柄限制的,而且L ...
- linux资源使用配置文件 /etc/security/limits.conf和ulimit
limits.conf文件实际上是linux PAM中pam_limits.so的配置文件,而且只针对于单个会话. limits.conf的格式如下: <domain> <type& ...
- file-max与ulimit的关系与差别
典型的,提供大量静态文件访问的web服务器,缓存服务器(如squid), 均要注意这个问题 网上的教程,大约只是简单说明了如何设置ulimit和file-max, 但并没有说清楚这两者之间的差别,让人 ...
随机推荐
- python获取文件夹下数量
import os totalSize = 0 fileNum = 0 dirNum = 0 def visitDir(path): global totalSize global fileNum g ...
- regex & tab spaces
regex & tab spaces txt file format let x = `2018-10-20a2018-10-20a2018-10-20a`; x.replace(/a/ig, ...
- [CF1036C]Classy Numbers
题目大意:多个询问,每个询问问$[l,r](1\leqslant l\leqslant r\leqslant10^{18})$内有多少个数满足非零数位小于等于$3$. 题解:数位$DP$,$f_{i, ...
- thr [树链剖分+dp]
题面 思路 首先,可以有一个$dp$的思路 不难发现本题中,三个点如果互相距离相同,那么一定有一个"中心点"到三个点的距离都相同 那么我们可以把本题转化计算以每个点为根的情况下,从 ...
- POJ3345 Bribing FIPA 【背包类树形dp】
题目链接 POJ 题解 背包树形dp板题 就是读入有点无聊,浪费了很多青春 #include<iostream> #include<cstdio> #include<cm ...
- 小L的占卜
小L的占卜 题目描述 小 X 的妹妹小 L 是一名 XXX 国的占卜师,她平日的工作就是为 X 国进行占卜. X 国的占卜殿中有一条长度为 NNN 米的走廊,先人在走廊的每一米都放置了一座神龛,第 i ...
- Codeforces Round #281 (Div. 2) B 模拟
B. Vasya and Wrestling time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- <a></a>的href属性失效
<a href="javascript:void(0);" class="close">关闭</a>
- CSS Sprites技术
CSS Sprites技术,国内很多人也叫雪碧图,因为sprite麻 (你买一瓶雪碧就看得到大大的sprite字样了) 主要用于将网站的零碎图标的img标签取代,因为每个img标签引用的src就会造成 ...
- laravel 学习笔记 —— 神奇的服务容器
转载自:https://www.insp.top/learn-laravel-container 容器,字面上理解就是装东西的东西.常见的变量.对象属性等都可以算是容器.一个容器能够装什么,全部取决于 ...