Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: recovering zombie process




----- Original Message ----- From: <pizomer@xxxxxxxxxxxxx>
To: <zsh-users@xxxxxxxxxx>
Sent: Tuesday, January 16, 2007 6:11 PM
Subject: recovering zombie process


I have the following problem. I crashed an mrxvt session
with 8 or more shells. Now all of them are zombie

ps wax | grep  zsh  show :
5138 tty3     Ss+    0:00 -zsh
5269 pts/1    Ss     0:00 zsh
5290 pts/2    Ss     0:00 zsh
5314 pts/3    Ss+    0:00 zsh
6032 pts/0    Ss     0:00 zsh
6755 pts/6    Ss+    0:03 -zsh
7588 pts/7    Ss+    0:01 -zsh
1961 pts/10   S+     0:00 -zsh
2434 pts/11   Ss+    0:01 -zsh
4659 pts/13   Ss     0:00 zsh
8568 pts/15   Ss+    0:00 zsh
29073 pts/16   Ss     0:00 -zsh
23181 pts/17   Ss+    0:00 -zsh
16833 pts/9    Ss+    0:00 -zsh
17134 pts/8    S+     0:00 -zsh
17758 pts/5    Ss+    0:00 -zsh
17851 pts/14   Ss     0:00 -zsh

The question is if someone know a way to recover them.
Maybe something like in reverse of clone.

They are not zombies, hey are perfectly live running processes.
I don't know what official term there might be for such processes but I call them headless. That is, processes which have become disconnected from their controlling tty and/or their parent process.
I guess orphan is already the term for when the parent process goes away.

In this case, it appears the tty has not gone away, merely the parent process.
what does "ps -ef" show?  or better yet "ps -o tty,pid,ppid,args -C zsh"
have all the PPID's turned to "1" ?

The only ways I know to reconnect to a session are:

1) commercial tty multiplexing/cloning software
   DoubleVision  (tridia.com)
   Peek (logmon.com)

2) freeware tty multiplexing/cloning software
   ttysnoop
   screen / mscreen

In all cases you had to be using the multiplexer before you created the tty so no matter what it's too late for this lot.

By rights, these processes should have all received a hangup when the parent went away. Since they didn't, and if this is going to happen from time to time, then you might want to install autolog or idled or other idle process killer which would send a hangup to any processes that appear like these automatically after they've been headless for whatever length of time you configure.

Perhaps the app that was managing the extra sessions (mrxvt) has a way to reconnect?
The fact that the tty's didn't change to "?" suggests this.

Brian K. White  --  brian@xxxxxxxxx  --  http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro  BBx    Linux  SCO  FreeBSD    #callahans  Satriani  Filk!



Messages sorted by: Reverse Date, Date, Thread, Author