如果我想将文件锁定为只读.甚至root也不能使用编辑器来修改它,只允许任何程序以只读方式打开它.
有什么建议?
我试过几种方法来改变URL的开放文件限制
http://www.cyberciti.biz/faq/linux-increase-the-maximum-number-of-open-files/
我已经更改了limit.conf和/etc/sysctl.conf
它与其他用户一起工作,但root的限制打开文件没有改变
#####
* - nproc 8500
* hard nofile 200000
* soft nofile 200000
* hard stack 8192
* hard sigpending 45056
root hard nofile 200000
root soft nofile 200000
root hard no file 200000
Run Code Online (Sandbox Code Playgroud)
# Controls the maximum number of shared memory segments, in pages
kernel.shmall = 4294967296
fs.file-max = 200000
Run Code Online (Sandbox Code Playgroud)
重启服务器,之后
[root@ironman ~]# ulimit -n
8192
Run Code Online (Sandbox Code Playgroud)
最后我在/ etc/bashrc上面添加命令,它对root用户也有效,我真的不明白为什么只在sysctl.conf /limits.conf上设置不会影响?
请指教
当断言失败并带有时间戳时,可以记录信息
恩.
int a = 10
assert( a > 100 );
Run Code Online (Sandbox Code Playgroud)
然后它将失败并输出就像时间戳一样
2013-12-02 , 17:00:05 assert failed !! (a > 100) line : 22
Run Code Online (Sandbox Code Playgroud)
谢谢