Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 02-10-2014, 02:31 PM   #1
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 487

Rep: Reputation: 29
shell terminated but process is still running

i was editing a file in vi and my internet connection when i try open the file it says that it was busy editing the file etc...and that the process is still do i get back to that vi session the id is 56183...any ideas of what i can do? vi -r didnt work

Old 02-10-2014, 02:52 PM   #2
Senior Member
Registered: Nov 2004
Location: Texas
Distribution: RHEL, Scientific Linux, Debian, Fedora
Posts: 3,935
Blog Entries: 5

Rep: Reputation: Disabled
(Assuming you're actually referring to 'vim' on a Linux system..)

Launch 'vi' (with no arguments), and try:
:recover file_name_here
Also, consider using 'GNU screen' or 'tmux' for your remote work, to avoid problems like this altogether.
Old 02-11-2014, 12:25 AM   #3
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 665

Rep: Reputation: Disabled
the last work wasnt saved, am i right ?
then just kill that process and start over.

what died is just your terminal session but the instance is still running that's why the process is alive and kept holding the lock on the file.
Old 02-11-2014, 08:59 AM   #4
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 6,192
Blog Entries: 12

Rep: Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122Reputation: 2122
Maybe the process is not running, because the parent (terminal) is gone; however maybe a temporary file of the type .<something> is there. I'm not a vim expert, but the later versions try to keep your last edit place on a file. And what I do know in a similar situation is if I have to force shutdown when I have a truecrypt volume mounted, it leaves a .truecrypt-lock-<myusername> file in my home; and when I boot back up I have to remove that file or it complains that truecrypt is already running. It really isn't, but the error says that because it sees the lock file. Therefore see if vim has some sort of lock file or a directory in your home containing something like that.
Old 02-11-2014, 05:32 PM   #5
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,418

Rep: Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398Reputation: 2398
You could try lsof to see exactly which file is open and try 'cat' ing that to a new temp file.
you may be able to recover most of it from there.
You can also check for eg a file called 'test.x' should have a backup (swp) file called '.test.x.swp' (note leading '.' .
You can see this using
ls -al
in the correct dir or as indicated by lsof above.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] To give an input to a running process using shell scripts rohan511 Linux - Newbie 2 12-19-2012 08:10 AM
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 04:47 AM
How to stop a process running in background (on a shell script) Azk00 Linux - Newbie 3 02-01-2008 05:24 AM
Keeping a process running after shell logout abboq Linux - Software 5 09-01-2004 06:58 PM
How to determine whether a PROCESS is running, by a SHELL program? yuzuohong Linux - General 4 01-21-2003 09:41 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration