From: Joseph Pingenot <trelane@digitasaru.net>
To: Al Viro <viro@ftp.linux.org.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: inotify and /proc/<pid>
Date: Mon, 30 Jul 2007 22:40:59 -0500 [thread overview]
Message-ID: <20070731034059.GF6812@digitasaru.net> (raw)
In-Reply-To: <20070731033631.GH21089@ftp.linux.org.uk>
>From Al Viro on Tuesday, 31 July, 2007:
>On Mon, Jul 30, 2007 at 10:31:13PM -0500, Joseph Pingenot wrote:
>> >From Joseph Pingenot on Monday, 30 July, 2007:
>> >From Al Viro on Tuesday, 31 July, 2007:
>> >>On Mon, Jul 30, 2007 at 09:16:16PM -0500, Joseph Pingenot wrote:
>> >>> I was trying to use inotify to watch process changes (especially process
>> >>> termination) by watching /proc/<pid>.
>> >>> Sadly, although I could see something reading various files, nothing
>> >>> was issued when the process I was watching exited and the directory
>> >>> went away.
>> >>> Is this intentional, or a bug?
>> >>It's a bug you intend to introduce in your program... IOW, don't
>> >>do that.
>> >More background, please?
>> >What's the way to check for a process exiting without spinning?
>> I should also specify that the process being waited on is not a
>> child process-it's just some other process on the system.
>Umm... Any details on intended use? IOW, is that "I want to write
>an utility that would wait for given PID to exit, just for the hell
>of it" or is there something you are trying to implement using that?
I'm trying to implement pwait. It blocks until a specified PID exits,
and then it exits.
You can use it to do other stuff after a program finishes.
While we're on the subject, is there some way to receive notification
that some aspect of a process changes (in this case, stopping using
CPU, but not exiting).
Thanks for the time to help me figure this out.
-Joseph
--
trelane@digitasaru.net.///////////////////////////////////////////////
"There is also an entire branch in the physical therapy field dedicated
to the treatment of little-finger injuries caused by excessive Emacs
use." --Linux Weekly News editor (http://lwn.net/Articles/206916/)
///////260 IATL / The University of Iowa / Iowa City, IA 52242///////
next prev parent reply other threads:[~2007-07-31 3:41 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 2:16 inotify and /proc/<pid> Joseph Pingenot
2007-07-31 3:17 ` Al Viro
2007-07-31 3:25 ` Joseph Pingenot
2007-07-31 3:31 ` Joseph Pingenot
2007-07-31 3:36 ` Al Viro
2007-07-31 3:40 ` Joseph Pingenot [this message]
2007-07-31 3:48 ` Kyle McMartin
2007-07-31 3:50 ` Al Viro
2007-07-31 3:56 ` Joseph Pingenot
2007-07-31 4:01 ` Al Viro
2007-08-01 1:33 ` Valdis.Kletnieks
2007-07-31 5:48 ` Chris Friesen
2007-07-31 3:31 ` Al Viro
2007-07-31 15:50 ` Ray Lee
2007-07-31 18:31 ` Diego Calleja
2007-08-01 0:41 ` Andrew Morton
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=20070731034059.GF6812@digitasaru.net \
--to=trelane@digitasaru.net \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@ftp.linux.org.uk \
/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