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?
-Joseph
--
tre...@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///////
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majo...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
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?
-Joseph
--
tre...@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///////
Depends on what that process is and how it is related to watching
one...
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
--
tre...@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///////
ptrace with options set to PTRACE_O_TRACEEXIT?
--Kyle
er... ptrace(2)?
Should work for most common usage scenarios, although will suspect that it
won't for for processes owned by another user (at least, I hope
it wouldn't).
What is dangerous about inotify on a proc file?
--
tre...@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///////
Playing with the lifetime rules, for starters...
> 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).
For some internal stuff a while back I did a patch that allows any
process to register for status change notifications. Basically, the
registered process gets put on a list and gets the same notifications
(killed/stopped/exited, etc.) as the real parent.
Useful for this type of thing.
Chris
I think you can get it from the taskstats interface, though I haven't
tried it. See Documentation/accounting/ for details.
Ray
> More background, please?
>
> What's the way to check for a process exiting without spinning?
I don't know if it's useful for you, but CONFIG_CONNECTOR and CONFIG_PROC_EVENTS
will report process creation/exit/fork/etc through a netlink interface.
> El Mon, 30 Jul 2007 22:25:21 -0500, Joseph Pingenot <tre...@digitasaru.net> escribió:
>
> > More background, please?
> >
> > What's the way to check for a process exiting without spinning?
>
>
> I don't know if it's useful for you, but CONFIG_CONNECTOR and CONFIG_PROC_EVENTS
> will report process creation/exit/fork/etc through a netlink interface.
yup. See example code in Documentation/accounting/getdelays.c
And if it's dangerous, should the inotify system call fail when trying to
set the watch? Bailout with a -EBADIDEA or something?