centos编辑/usr/lib/systemd/system/docker.service提示Found a swap file by the name “/usr/lib/systemd/syst

最近为了整合idea与docker,现在要开放一个对外的端口,但是又不想使用默认的端口2375,因为对外暴露容易被攻击,如果是内网下测试还可以,但如果是自己服务器则不建议使用默认端口,
在操作过程中,使用如下命令修改配置文件的时候

vim /usr/lib/systemd/system/docker.service

提示如下:

E325: ATTENTION
Found a swap file by the name "/usr/lib/systemd/system/.docker.service.swp"
          owned by: root   dated: Sun Mar 28 15:04:01 2021
         file name: /usr/lib/systemd/system/docker.service
          modified: YES
         user name: root   host name: VM-0-15-centos
        process ID: 17786 (still running)
While opening file "/usr/lib/systemd/system/docker.service"
             dated: Sun Mar 28 16:03:10 2021
      NEWER than swap file!

(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 /usr/lib/systemd/system/docker.service"
    to recover the changes (see ":help recovery").
    If you did this already, delete the swap file "/usr/lib/systemd/system/.docker.service.swp"
    to avoid this message.

Swap file "/usr/lib/systemd/system/.docker.service.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (Q)uit, (A)bort:

这段话大概意思是,找到了一个后缀为.swp的交换文件,可是去/usr/lib/systemd/system/下将这个删除,然后再去编辑
我使用了如下命令

rm -rf .docker.service.swp

然后再使用命令,则正常了

vim /usr/lib/systemd/system/docker.service
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

A吴广智

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值