嘿嘿,我去编辑我的 nginx 默认配置文件,以 nano 作为 root。
我保存了文件。然后我又去编辑它,我得到了错误:
[读取锁定文件时出错./.default.swp:读取数据不足] nano。
建议和原因?
更新删除 .swp 文件有效,但是每次保存文件时都会遇到此问题,我必须再次删除交换以重新编辑...
Deleting the swap file allowed me to edit the config file again.
However, my ultimate problem was a faulty CRON job that had used all the filesystem memory creating files. [The delete CRON was bugged, the write CRON wasn't ;)]
Fixing that prevented the swap files from becoming corrupted.
检查机器的内存。如果它已满,则会导致相同的错误。尝试删除一些不必要的文件,如旧日志。同时删除交换文件。