vi
でphp.ini
を編集中にセッションが切れてしまい、慌てて繋ぎ直して編集を再開したら以下の警告が表示されてしまいました。
E325: ATTENTION
Found a swap file by the name "/etc/.php.ini.swp"
owned by: root dated: Thu Mar 19 16:53:55 2020
file name: /etc/php.ini
modified: YES
user name: root host name: pulldullfull.example.com
process ID: 8316 (still running)
While opening file "/etc/php.ini"
dated: Wed Mar 18 19:49:58 2020
(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 /etc/php.ini"
to recover the changes (see ":help recovery").
If you did this already, delete the swap file "/etc/.php.ini.swp"
to avoid this message.
"/etc/php.ini" 1689L, 63807C
Press ENTER or type command to continue
編集途中のファイルのバックアップができているのでどうしますか、ということのようです。
検索したところ、.swp
ファイルを削除すれば編集前のものを再び編集できるようになるようです。
# cd /etc/
# ls -la
## 略
drwxr-xr-x. 147 root root 12288 3月 19 17:02 .
dr-xr-xr-x. 18 root root 4096 3月 18 16:25 ..
-rw-r--r-- 1 root root 20480 3月 19 16:53 .php.ini.swp
## 略
-rw-r--r-- 1 root root 63807 3月 18 19:49 php.ini
## 略
確かに.php.ini.swp
ができています。
# rm .php.ini.swp
rm: 通常ファイル '.php.ini.swp' を削除しますか? y
削除。
# vi php.ini
[PHP]
;;;;;;;;;;;;;;;;;;;
; About php.ini ;
;;;;;;;;;;;;;;;;;;;
; 略
開けました。