首先我要编辑修改/etc/security/limits.conf
vi进去后却提示这个
然后修改保存:wq的时候却报错这个
1、有会话打开了这个文件,占用这个文件。
2、用户没有权限,或者有特殊权限i。
3、文件系统只读。
1、只有我打开这个文件,也重启过服务器。
2、文件所属用户跟用户组都是root,我是用root用户编辑,读写执行权限都有,也没有特殊权限i 锁定。
3、/etc下的其他目录文件是有可以修改删除的。
然后我突然发现目录下都了许多limits.的其它文件
E325: ATTENTION
Found a swap file by the name "limits_c.swp"
owned by: root dated: Tue May 24 10:42:59 2022
[cannot be read]
While opening file "limits.conf"
dated: Sun Apr 28 09:56:17 2019
(1) Another program may be editing the same file. If this is the case,
be careful not to end up with two different instances of the same
file when making changes. Quit, or continue with caution.
(2) An edit session for this file crashed.
If this is the case, use ":recover" or "vim -r limits.conf"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "limits_c.swp"
to avoid this message.
"limits.conf" 54L, 1926C
网上说需要删除掉limits_c.swp.我试了下这些文件还是删不掉
又回到最初的起点。
退出来,删除limits_c.swp文件,然后再vi 这个文件
解决方法
root运行试过没
sudo vi /etc/security/limits.conf
或者
关机重启下
sudo vi /etc/security/limits.conf
或者
sudo cp /etc/security/limits.conf sudo vi /etc/security/limits.conf.back
sudo rmi /etc/security/limits.conf
sudo vi /etc/security/limits.conf
如有问题及时沟通
你发的第一张图片就告诉你怎么处理了。。vim -r limits.conf,保存的时候可以试下wq!
文件系统只读的原因确认过了吗?你在这个目录新建一个文件试试
看一下磁盘占用空间
(1)权限不够的(只读)
(2)此文件可能正被其他程序或用户使用
解决:redhat6.9可以退出,但是不会保存内容
重新启动后,查看文件权限,如果没有这个文件,则建立