public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Bernard Blackham <bernard@blackham.com.au>
To: Ed Tomlinson <tomlins@cam.org>
Cc: lokum spand <lokumsspand@hotmail.com>, linux-kernel@vger.kernel.org
Subject: Re: A possible idea for Linux: Save running programs to disk
Date: Sun, 2 Oct 2005 22:16:37 +0800	[thread overview]
Message-ID: <20051002141637.GC5211@blackham.com.au> (raw)
In-Reply-To: <200510020857.27065.tomlins@cam.org>

On Sun, Oct 02, 2005 at 08:57:26AM -0400, Ed Tomlinson wrote:
> Is there any kernel api that adding would make cryopid more
> dependable/cleaner?

Currently a fair bit of information is obtained by injecting code
into the process's memory space, executing it, and reaping out the
results (eg, termcaps, file offsets, fcntl states, locks, signal
actions, etc).  Can't think of ways to make it cleaner off the top
of my head, but I'm open to ideas.

Seeing as you asked though, here's my wishlist :) I don't expect all
of these to be implemented, but every bit would help. Issues I
haven't been able to address so far:

 - Processes that cache their PID and need it, or rely on PIDs of
   their children.

   Some way to request a given PID when cloning/forking (or on the
   fly even) would make life easier.

 - UNIX sockets aren't currently supported but figuring out what is
   connected to what seems a little shaky. Some old code used to
   take a guess that socketpairs had inodes k and k+1 with k odd,
   which seemed to work in all cases I saw. It certainly didn't feel
   reliable though.
   
   An extra field in /proc/net/unix saying what inode socket was on
   the other end (only needed for the connect() end) would be great.

 - Setting cmdline as appears in /proc/$pid/cmdline. argv and
   environ point somewhere into the process's stack determined by
   the size of argv and environ at exec time. Without va space
   randomisation in the picture, it's not too difficult to reproduce
   this and get it back where it should be (it's a hack though), but
   with va space randomisation it's pretty much impossible.

   An API to change the actual memory location of this (task's
   mm->arg_start) would be handy (prctl maybe?)

 - Merging tcpcp for TCP connection saving support.

 - I haven't put a great deal of thought into the multithreading
   side of things, but a non-intrusive way to determine which
   threads share filesystem contexts, FDs, namespaces, VMAs, and so
   on would be infinitely useful. My current plan of attack was to
   tinker with one and see if I could observe it from the others.

That's all I can think of for now. If any of these look even
remotely plausible to incorporate, I'd be quite happy to prepare
patches (2 and 3 seem trivial enough :)

Kind regards,

Bernard.

  reply	other threads:[~2005-10-02 14:16 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-01 21:30 A possible idea for Linux: Save running programs to disk lokum spand
2005-10-01 21:39 ` Arjan van de Ven
2005-10-01 22:21   ` Michael Concannon
2005-10-01 22:51     ` lokum spand
2005-10-01 23:09       ` Michael Concannon
2005-10-02  8:30       ` Tomasz Torcz
2005-10-02 13:31       ` Benoit Boissinot
2005-10-02 18:49       ` Jon Masters
2005-10-02 19:21       ` Lexington Luthor
2005-10-02  0:34   ` grundig
2005-10-02  4:53 ` Bernard Blackham
2005-10-02 12:57   ` Ed Tomlinson
2005-10-02 14:16     ` Bernard Blackham [this message]
2005-10-10  1:13       ` serue
2005-11-06 15:42         ` Bernard Blackham
2005-11-09  2:15           ` Peter Chubb
2005-10-02  5:36 ` Andrew Haninger
2005-10-03 17:41   ` Adrian Bunk
2005-10-03 18:52     ` Andrew Haninger
2005-10-03 18:59       ` Adrian Bunk
2005-10-03 19:48         ` Andrew Haninger
2005-10-02 18:46 ` Jon Masters
     [not found] <4SXfo-7hM-9@gated-at.bofh.it>
2005-10-02  3:19 ` Bodo Eggert
     [not found] ` <4T47e-5E-1@gated-at.bofh.it>
     [not found]   ` <4TbLq-2VG-5@gated-at.bofh.it>
     [not found]     ` <4TcR9-4sS-9@gated-at.bofh.it>
2005-10-02 17:08       ` Bodo Eggert
2005-10-02 17:51         ` Bernard Blackham
2005-10-02 19:13           ` Jeff Dike
2005-10-03 20:02           ` Pavel Machek

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=20051002141637.GC5211@blackham.com.au \
    --to=bernard@blackham.com.au \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lokumsspand@hotmail.com \
    --cc=tomlins@cam.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