[Dovecot] inotify support in dovecot

Reuben Farrelly reuben-dovecot at reub.net
Mon Jul 25 11:51:58 EEST 2005


Hi again Johannes,

On 25/07/2005 7:37 p.m., Johannes Berg wrote:
> Hi,
> 
>> I note that dovecot supported inotify from -test77, and now the Linux kernel 
>> supports it starting from linux-2.6.13-rc3.  So in theory I should be set to 
>> go.  I'm using an -mm kernel, and it was built with inotify, on FC4/devel.
> 
> I suppose I'll reply since I wrote the code ;)
> 
>> checking for poll... yes
>> configure: error: inotify requested but not available, check for existence of 
>> <linux/inotify.h>
>> /bin/sh ./config.status --recheck
> 
> Makes sense, you need the inotify userspace header.
> 
>> What is required for inotify to be recognised and built into dovecot?  I've 
>> tried copying the header from linux-2.6/include/linux/inotify.h to the 
>> /usr/include/linux directory, but that didn't help - and seems wrong to do anyway.
> 
> Sounds about right -- that particular header is safe for userspace. But
> if that didn't help then I don't know what's going wrong. Check
> config.log please.

| #define IOLOOP_POLL
| /* end confdefs.h.  */
|
|     #define _GNU_SOURCE
|     #include <sys/ioctl.h>
|     #include <fcntl.h>
|     #include <linux/inotify.h>
|
| int
| main ()
| {
|
|     struct inotify_watch_request req;
|     int wd, dev_fd;
|     char * fn = "/tmp";
|     dev_fd = open ("/dev/inotify", O_RDONLY);
|     req.fd = open (fn, O_RDONLY);
|     if (req.fd < 0) return -1;
|     req.mask = IN_CREATE | IN_DELETE | IN_MOVED_FROM | IN_MOVED_TO |
IN_MODIFY | IN_ACCESS;
|     wd = ioctl (dev_fd, INOTIFY_WATCH, &req);
|     close(req.fd);
|     ioctl (dev_fd, INOTIFY_IGNORE, &wd);
|
|   ;
|   return 0;
| }
configure:23296: error: inotify requested but not available, check for
existence of <linux/inotify.h>



> Also, please try the header from
> http://www.kernel.org/pub/linux/kernel/people/rml/inotify/headers/

It's bit-for-bit identical with the one in the kernel - tested with both and 
diffed :)

inotify is definitely there and built into the kernel:

[root at tornado ~]# cat /proc/sys/fs/inotify/max_
max_queued_events   max_user_instances  max_user_watches
[root at tornado ~]#

and here:

[root at tornado tmp]# ls -la /usr/include/linux/inotify.h
-rw-r--r--  1 root root 3386 Jul 20 01:29 /usr/include/linux/inotify.h
[root at tornado tmp]#

and here:

[root at tornado tmp]# ls -la /dev/inotify
crw-r--r--  1 root root 10, 63 Jul 25 20:03 /dev/inotify
[root at tornado tmp]#

I tried with latest -mm kernel, as well as latest Fedora devel kernel - all 
are supposed to have inotify support, but both have the same problem.

Not sure what else I can really try :(  Have you got any other ideas?

Reuben





More information about the dovecot mailing list