To add to acid_kewpie
To check if the file is in use (option 1 in your message above), you can run
ps -ef |grep myfile as shown below for file abc.txt (user liza is editing file abc.txt using vi)
Code:
wim@aa0:~$ ps -ef |grep abc.txt
liza 7802 7723 0 07:36 pts/3 00:00:00 vi abc.txt
wim 7804 7512 0 07:36 pts/1 00:00:00 grep abc.txt
wim@aa0:~$
The first line in the output (in this case) shows that user liza is editing the file (the second line in the output reflects the grep command and is not relevant). Ask the user to stop editing and quit vi.
If the first line does not show, you can delete the swp file (if you have permissions) or ask the 'owner' to delete it. This is usually, as indicated in option 2 in the message that you got, the result of a crash of the vi session (e.g. vi killed with a
kill -9 pid_of_vi_session).