Re: [BUG] Using inotify on /proc/partitoins

2013-06-13 Thread Al Viro
On Fri, Jun 14, 2013 at 09:26:49AM +0800, majianpeng wrote: > Hi all, > I wanted to monitor /proc/partitions using inotify. That, indeed, is a bug. Easily fixed - don't do that. > But when i call 'cat /proc/partitions',the program can't return. > So i added some message in ker

[BUG] Using inotify on /proc/partitoins

2013-06-13 Thread majianpeng
Hi all, I wanted to monitor /proc/partitions using inotify.Although now i know it can't catch the event of write. But for read,it can't catch. The code is: int main() { int fd = inotify_init(); int wd; char buff[4096]; int ret; if (fd < 0)

[BUG] Using inotify on /proc/partitoins

2013-06-13 Thread majianpeng
Hi all, I wanted to monitor /proc/partitions using inotify.Although now i know it can't catch the event of write. But for read,it can't catch. The code is: int main() { int fd = inotify_init(); int wd; char buff[4096]; int ret; if (fd 0)

Re: [BUG] Using inotify on /proc/partitoins

2013-06-13 Thread Al Viro
On Fri, Jun 14, 2013 at 09:26:49AM +0800, majianpeng wrote: Hi all, I wanted to monitor /proc/partitions using inotify. That, indeed, is a bug. Easily fixed - don't do that. But when i call 'cat /proc/partitions',the program can't return. So i added some message in kernel in order

Re: inotify and /proc/

2007-07-31 Thread Valdis . Kletnieks
it exits. > >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? And if it's dangerous, should the in

Re: inotify and /proc/

2007-07-31 Thread Andrew Morton
On Tue, 31 Jul 2007 20:31:49 +0200 Diego Calleja <[EMAIL PROTECTED]> wrote: > El Mon, 30 Jul 2007 22:25:21 -0500, Joseph Pingenot <[EMAIL PROTECTED]> > escribió: > > > More background, please? > > > > What's the way to check for a process exiting without spinning? > > > I don't know if it's

Re: inotify and /proc/

2007-07-31 Thread Diego Calleja
El Mon, 30 Jul 2007 22:25:21 -0500, Joseph Pingenot <[EMAIL PROTECTED]> 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

Re: inotify and /proc/

2007-07-31 Thread Ray Lee
On 7/30/07, Joseph Pingenot <[EMAIL PROTECTED]> wrote: > What's the way to check for a process exiting without spinning? I think you can get it from the taskstats interface, though I haven't tried it. See Documentation/accounting/ for details. Ray - To unsubscribe from this list: send the line

Re: inotify and /proc/pid

2007-07-31 Thread Ray Lee
On 7/30/07, Joseph Pingenot [EMAIL PROTECTED] wrote: What's the way to check for a process exiting without spinning? I think you can get it from the taskstats interface, though I haven't tried it. See Documentation/accounting/ for details. Ray - To unsubscribe from this list: send the line

Re: inotify and /proc/pid

2007-07-31 Thread Diego Calleja
El Mon, 30 Jul 2007 22:25:21 -0500, Joseph Pingenot [EMAIL PROTECTED] 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

Re: inotify and /proc/pid

2007-07-31 Thread Andrew Morton
On Tue, 31 Jul 2007 20:31:49 +0200 Diego Calleja [EMAIL PROTECTED] wrote: El Mon, 30 Jul 2007 22:25:21 -0500, Joseph Pingenot [EMAIL PROTECTED] 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,

Re: inotify and /proc/pid

2007-07-31 Thread Valdis . Kletnieks
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? And if it's dangerous, should the inotify system call fail when trying to set the watch? Bailout

Re: inotify and /proc/

2007-07-30 Thread Chris Friesen
Joseph Pingenot wrote: 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

Re: inotify and /proc/

2007-07-30 Thread Al Viro
en it exits. > >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? Playing with the lifetime

Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
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? -- [EMAIL PROTECTED]/// "There is also an entire branch in the physical therapy field d

Re: inotify and /proc/

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote: > I'm trying to implement pwait. It blocks until a specified PID exits, > and then it exits. er... ptrace(2)? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED]

Re: inotify and /proc/

2007-07-30 Thread Kyle McMartin
On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote: > 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,

Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
>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

Re: inotify and /proc/

2007-07-30 Thread Al Viro
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

Re: inotify and /proc/

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:25:21PM -0500, Joseph Pingenot wrote: > >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/. > >>

Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
>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/. >>> Sadly, although I

Re: inotify and /proc/

2007-07-30 Thread Joseph Pingenot
>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/. >> Sadly, although I could see something reading various files, nothing >>

Re: inotify and /proc/

2007-07-30 Thread Al Viro
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/. > > Sadly, although I could see something reading various files, nothing > was issued when the process I was watching

inotify and /proc/

2007-07-30 Thread Joseph Pingenot
I was trying to use inotify to watch process changes (especially process termination) by watching /proc/. 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?

inotify and /proc/pid

2007-07-30 Thread Joseph Pingenot
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?

Re: inotify and /proc/pid

2007-07-30 Thread Al Viro
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

Re: inotify and /proc/pid

2007-07-30 Thread Joseph Pingenot
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

Re: inotify and /proc/pid

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:25:21PM -0500, Joseph Pingenot wrote: 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,

Re: inotify and /proc/pid

2007-07-30 Thread Joseph Pingenot
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

Re: inotify and /proc/pid

2007-07-30 Thread Al Viro
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

Re: inotify and /proc/pid

2007-07-30 Thread Joseph Pingenot
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

Re: inotify and /proc/pid

2007-07-30 Thread Kyle McMartin
On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote: 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

Re: inotify and /proc/pid

2007-07-30 Thread Al Viro
On Mon, Jul 30, 2007 at 10:40:59PM -0500, Joseph Pingenot wrote: I'm trying to implement pwait. It blocks until a specified PID exits, and then it exits. er... ptrace(2)? - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED]

Re: inotify and /proc/pid

2007-07-30 Thread Joseph Pingenot
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? -- [EMAIL PROTECTED]/// There is also an entire branch in the physical therapy field dedicated to the treatment of little-finger

Re: inotify and /proc/pid

2007-07-30 Thread Al Viro
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? Playing with the lifetime rules, for starters... - To unsubscribe from this list: send the line

Re: inotify and /proc/pid

2007-07-30 Thread Chris Friesen
Joseph Pingenot wrote: 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

Re: inotify and /proc?

2007-06-24 Thread Kyle Moffett
On Jun 22, 2007, at 18:51:10, C. Scott Ananian wrote: Back to kernel-land: in an IPv6 only world, it might make sense to export a /proc file compatible with the format of /etc/resolv.conf, with one DNS server address per line. If glibc uses/used inotify on /etc/resolv.conf, then symlinking

Re: inotify and /proc?

2007-06-24 Thread Kyle Moffett
On Jun 22, 2007, at 18:51:10, C. Scott Ananian wrote: Back to kernel-land: in an IPv6 only world, it might make sense to export a /proc file compatible with the format of /etc/resolv.conf, with one DNS server address per line. If glibc uses/used inotify on /etc/resolv.conf, then symlinking

Re: inotify and /proc?

2007-06-22 Thread Al Viro
On Fri, Jun 22, 2007 at 06:51:10PM -0400, C. Scott Ananian wrote: > No, clearly inotify on all files in /proc is not the right thing to > do. But I'm writing support for "RDNSS in RA" -- IPv6 Router > Advertisement messages can include a DNS server specification, which > makes IPv6 completely

Re: inotify and /proc?

2007-06-22 Thread C. Scott Ananian
ant that in the first place. If we wanted inotify on /proc, it should work on all files I guess, but that's an immense amount of work. No, clearly inotify on all files in /proc is not the right thing to do. But I'm writing support for "RDNSS in RA" -- IPv6 Router Advertisement messages c

Re: inotify and /proc?

2007-06-22 Thread C. Scott Ananian
inotify on /proc, it should work on all files I guess, but that's an immense amount of work. No, clearly inotify on all files in /proc is not the right thing to do. But I'm writing support for RDNSS in RA -- IPv6 Router Advertisement messages can include a DNS server specification, which makes

Re: inotify and /proc?

2007-06-22 Thread Al Viro
On Fri, Jun 22, 2007 at 06:51:10PM -0400, C. Scott Ananian wrote: No, clearly inotify on all files in /proc is not the right thing to do. But I'm writing support for RDNSS in RA -- IPv6 Router Advertisement messages can include a DNS server specification, which makes IPv6 completely

Re: inotify and /proc?

2007-06-21 Thread Arnd Bergmann
eems to do what I want, but it takes > a struct dentry * -- how can I get a dentry from a struct > proc_dir_entry and increment its ref count to keep it around?  Any > help would be appreciated.  Thanks! It sounds a little fishy to want that in the first place. If we wanted inotify on /pro

inotify and /proc?

2007-06-21 Thread C. Scott Ananian
I'd like to make a read-only /proc file which supports inotify -- that is, the kernel can send change notifications to userland via the inotify mechanism. I've found fsnotify_modify() (in include/linux/fsnotify.h) which seems to do what I want, but it takes a struct dentry * -- how can I get a

Re: inotify and /proc?

2007-06-21 Thread Arnd Bergmann
want, but it takes a struct dentry * -- how can I get a dentry from a struct proc_dir_entry and increment its ref count to keep it around?  Any help would be appreciated.  Thanks! It sounds a little fishy to want that in the first place. If we wanted inotify on /proc, it should work on all files I

inotify monitoring /proc

2007-02-08 Thread Mariusz Gniazdowski
Hi Can inotify monitor /proc? I would like to catch process creation and deletion events. My first attempts are not succesul. -- Regards Mariusz - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo inf

inotify monitoring /proc

2007-02-08 Thread Mariusz Gniazdowski
Hi Can inotify monitor /proc? I would like to catch process creation and deletion events. My first attempts are not succesul. -- Regards Mariusz - To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http