From: vikashskumar@gmail.com (Vikash Kumar)
To: kernelnewbies@lists.kernelnewbies.org
Subject: executable ELF is rm-ed from disk, but still running RAM..
Date: Tue, 31 May 2011 10:26:25 +0530 [thread overview]
Message-ID: <BANLkTikav59rChzB=wirvMH_7NT34yf3OQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTima=B180P0yp1ps124RpauVHtQuwA@mail.gmail.com>
AFAIK Linux removes the directory entry and reduces the reference count of
Inode of a running process and rm is successful. So, you can't see it in the
file system anymore. However as the program is still running the inode
reference count is still not zero and so the Inode and hence file is
actually not deleted yet. When the program will terminate, Inode ref count
will drop to zero and in that case the Inode and file will be freed.
"The design of Unix Operating System" by Maurice J. Bach It covers these
basic design principles in good detail.
On Tue, May 31, 2011 at 10:12 AM, Manish Katiyar <mkatiyar@gmail.com> wrote:
> On Mon, May 30, 2011 at 8:45 PM, Mulyadi Santosa
> <mulyadi.santosa@gmail.com> wrote:
> > hi..
> >
> > On Tue, May 31, 2011 at 09:57, Manish Katiyar <mkatiyar@gmail.com>
> wrote:
> >> How will "rm /bin/rm" work otherwise ?
> >
> > ok, makes me think another case....suppose we erase the related data
> > blocks in the disk that correlate to running binary.... does Linux
> > kernel follow that with erasing all the related page cache? or is it
> > possible that temporarily cache of the disk blocks still survived?
>
> I don't know for sure, but my guess is that the OS wouldn't notice it
> till it goes out of cache and it has to reload.
>
> --
> Thanks -
> Manish
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110531/fe0eda3a/attachment-0001.html
next prev parent reply other threads:[~2011-05-31 4:56 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-30 14:49 executable ELF is rm-ed from disk, but still running RAM Mulyadi Santosa
2011-05-30 16:26 ` Jonathan Neuschäfer
2011-05-31 1:25 ` Pei Lin
2011-05-31 2:46 ` Mulyadi Santosa
2011-05-31 2:57 ` Manish Katiyar
2011-05-31 3:45 ` Mulyadi Santosa
2011-05-31 4:42 ` Manish Katiyar
2011-05-31 4:56 ` Vikash Kumar [this message]
2011-05-31 6:53 ` Mulyadi Santosa
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='BANLkTikav59rChzB=wirvMH_7NT34yf3OQ@mail.gmail.com' \
--to=vikashskumar@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).