天天看點

【Linux】limits.conf 不重新開機就生效或者不生效的原因

前陣子,我要用到使LInux的檔案打開數為65534個,而且需要永久生效,于是将配置寫到了:

vim /etc/security/limits.conf

* soft nofile 65534

* hard nofile 65534

重新登入後limit.conf的配置都不生效,後來發現,ubuntu有個bug,root使用者必須注明使用者

root soft nofile 65534

root hard nofile 65534

也就是寫成上面那樣,重新登入,不需要重新開機,ulimit -a可以看到檔案打開數已經是65534了,這就是limits.conf不生效的原因,注意ubuntu一定不能直接用*

繼續閱讀