LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 02-10-2014, 01:31 PM   #1
sigint-ninja
Member
 
Registered: Feb 2011
Location: Republic Of Ireland
Distribution: Debian,Centos,Slackware
Posts: 483

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


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

thanks
 
Old 02-10-2014, 01:52 PM   #2
anomie
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:
Code:
:recover file_name_here
Also, consider using 'GNU screen' or 'tmux' for your remote work, to avoid problems like this altogether.
 
Old 02-10-2014, 11:25 PM   #3
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 81
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, 07:59 AM   #4
rtmistler
Moderator
 
Registered: Mar 2011
Location: Sutton, MA. USA
Distribution: MINT Debian, Angstrom, SUSE, Ubuntu
Posts: 5,429
Blog Entries: 12

Rep: Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893Reputation: 1893
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, 04:32 PM   #5
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
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
Code:
ls -al
in the correct dir or as indicated by lsof above.
http://linux.die.net/man/8/lsof
 
  


Reply


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 07:10 AM
Shell Script : Kill a running process when another process starts ashmew2 Linux - General 3 08-20-2008 03:47 AM
How to stop a process running in background (on a shell script) Azk00 Linux - Newbie 3 02-01-2008 04:24 AM
Keeping a process running after shell logout abboq Linux - Software 5 09-01-2004 05:58 PM
How to determine whether a PROCESS is running, by a SHELL program? yuzuohong Linux - General 4 01-21-2003 08:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:27 AM.

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