#106 Support for the BSD family (kqueue-based monitoring)

Unstable (example)
open
nobody
None
8
2014-02-14
2013-11-11
hedger
No

I've implemented a kqueue/kevent-based filesystem polling. Tested on FreeBSD 9.1-RELEASE amd64.
Also avaliable at my github page.

1 Attachments

Related

Patches: #106

Discussion

  • William Grzybowski

    +1 for this, nice job.

     
  • macioxl

    macioxl - 2013-11-21

    hedger's patch for minidlna 1.1.1

     
  • Mark Thompson

    Mark Thompson - 2013-12-13

    I have recently built the minidlna program on a virgin FreeBSD 9.2-RELEASE amd64 system from the ports collection. The build was fine and MiniDLNA works fine, well it works as before however I am unable to get it to notice any changes to the media directory. I deleted, created, and renamed files and waited over an hour yet no update to the media list. pkg_info does list "minidlna-1.1.1_1,1". Is there something I'm missing?

     
    • macioxl

      macioxl - 2013-12-15

      There is problem with port version. It doesn't work for me if build straight from ports. Apply patch by yourself.

      cd /usr/ports/net/minidlna/files
      rm patch-inotify.c patch-inotify.h patch-metadata.c patch-minidlna.c patch-scanner.c patch-configure.ac
      cd /usr/ports/net/minidlna
      make extract
      cd work/minidlna-1.1.1/
      fetch http://sourceforge.net/p/minidlna/patches/_discuss/thread/07d72b10/6066/attachment/minidlna.1.1.1.kq.patch
      patch -p1 < minidlna.1.1.1.kq.patch

      there should be message about successfully applying patch
      "Patching file scanner.c using Plan A...
      Hunk #1 succeeded at 590.
      done"

      cd /usr/ports/net/minidlna
      make
      make reinstall (or "make install" if port was not installed before)
      make clean

      Restart service and check if it works. It does for me.

       
      Last edit: macioxl 2013-12-15
  • hedger

    hedger - 2013-12-14

    Try running just once
    /usr/local/etc/rc.d/minidlna rescan
    Also make sure that you have "inotify=yes" in your configuration. If it still won't work, enable 'debug' level loggging, perform some operations on your files and send me your minidlna.log.

     
    • Mark Thompson

      Mark Thompson - 2013-12-15

      I have attached both the minidlna.log and minidlna.conf files.

      At time 19:08 I copied a file called in the /media directory.
      At time 19:21 I entered the command /usr/local/etc/rc.d/minidlna rescan

      I hope all this debug information makes sense. If you need me to change the
      log level values, please specify what you want.

      Thanks,
      Mark

      -----Original Message-----
      From: hedger [mailto:tehhedger@users.sf.net]
      Sent: Saturday, December 14, 2013 4:22 PM
      To: [minidlna:patches] ; [minidlna:patches]
      Subject: [minidlna:patches] #106 Support for the BSD family (kqueue-based
      monitoring)

      Try running just once
      /usr/local/etc/rc.d/minidlna rescan Also make sure that you have
      "inotify=yes" in your configuration. If it still won't work, enable 'debug'
      level loggging, perform some operations on your files and send me your
      minidlna.log.


      [patches:#106] Support for the BSD family (kqueue-based monitoring)

      Status: open
      Created: Mon Nov 11, 2013 10:48 PM UTC by hedger
      Last Updated: Fri Dec 13, 2013 05:49 PM UTC
      Owner: nobody

      I've implemented a kqueue/kevent-based filesystem polling. Tested on FreeBSD
      9.1-RELEASE amd64.
      Also avaliable at my github
      page
      .


      Sent from sourceforge.net because you indicated interest in
      https://sourceforge.net/p/minidlna/patches/106/

      To unsubscribe from further messages, please visit
      https://sourceforge.net/auth/subscriptions/

       

      Related

      Patches: #106

      • hedger

        hedger - 2013-12-15

        Your log file doesn't contain any traces of kqueue-related stuff. It looks like configure failed to determine that it can use kqueue. Post your 'minidlna/work/minidlna-1.1.1/config.h' and 'minidlna/work/minidlna-1.1.1/config.log', please.

         
        • Mark Thompson

          Mark Thompson - 2013-12-15

          Here are the attached files requested. I have to run 'make install' in
          order to create the files since they were deleted during the original build.

          -----Original Message-----
          From: hedger [mailto:tehhedger@users.sf.net]
          Sent: Sunday, December 15, 2013 7:46 AM
          To: [minidlna:patches]
          Subject: [minidlna:patches] Re: #106 Support for the BSD family
          (kqueue-based monitoring)

          Your log file doesn't contain any traces of kqueue-related stuff. It looks
          like configure failed to determine that it can use kqueue. Post your
          'minidlna/work/minidlna-1.1.1/config.h' and
          'minidlna/work/minidlna-1.1.1/config.log', please.


          [patches:#106] Support for the BSD family (kqueue-based monitoring)

          Status: open
          Created: Mon Nov 11, 2013 10:48 PM UTC by hedger Last Updated: Sat
          Dec 14, 2013 09:22 PM UTC
          Owner: nobody

          I've implemented a kqueue/kevent-based filesystem polling. Tested on FreeBSD
          9.1-RELEASE amd64.
          Also avaliable at my github
          page
          .


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/minidlna/patches/106/

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/

           

          Related

          Patches: #106

          • hedger

            hedger - 2013-12-15

            Are you sure that your port snapshot is up-to-date? According to your files, patches to configure.ac enabling kqueue-related defines weren't applied at all.

             
            • Mark Thompson

              Mark Thompson - 2013-12-15

              I just ran 'portsnap update' and it says the ports tree is already up to
              date.

              Under '/usr/ports/net/minidlna/files' there are several patch files. Do I
              need to run something special to make those work during the build? They
              seem to have the changes you are talking about.

              So I looked at configure.ac using 'ee' and at line 456 the single line
              change is present, the addition of 'sys/event.h' with matches the expected
              change. Also I have 'configure.ac.orig' without the change and is expected.

              -----Original Message-----
              From: hedger [mailto:tehhedger@users.sf.net]
              Sent: Sunday, December 15, 2013 12:19 PM
              To: [minidlna:patches]
              Subject: [minidlna:patches] Re: #106 Support for the BSD family
              (kqueue-based monitoring)

              Are you sure that your port snapshot is up-to-date? According to your files,
              patches to configure.ac enabling kqueue-related defines weren't applied at
              all.


              [patches:#106] Support for the BSD family (kqueue-based monitoring)

              Status: open
              Created: Mon Nov 11, 2013 10:48 PM UTC by hedger Last Updated: Sun
              Dec 15, 2013 05:18 PM UTC
              Owner: nobody

              I've implemented a kqueue/kevent-based filesystem polling. Tested on FreeBSD
              9.1-RELEASE amd64.
              Also avaliable at my github
              page
              .


              Sent from sourceforge.net because you indicated interest in
              https://sourceforge.net/p/minidlna/patches/106/

              To unsubscribe from further messages, please visit
              https://sourceforge.net/auth/subscriptions/

               

              Related

              Patches: #106

              • hedger

                hedger - 2013-12-15
                 
                Last edit: hedger 2013-12-15
                • Mark Thompson

                  Mark Thompson - 2013-12-16

                  I'm not sure where to go from here. I'm making an assumption you have it
                  working on your machine just fine?

                  Here is the '/usr/ports/net/minidlna/work/minidlna-1.1.1/configure.ac' file
                  so you can look to ensure I'm not mis-reading something.

                  Speaking of the 'event.h' file, I don't see it listed in the
                  'work/minidlna-1.1.1/' directory. Is that the problem that the file doesn't
                  exist?

                  -----Original Message-----
                  From: hedger [mailto:tehhedger@users.sf.net]
                  Sent: Sunday, December 15, 2013 3:49 PM
                  To: [minidlna:patches]
                  Subject: [minidlna:patches] Re: #106 Support for the BSD family
                  (kqueue-based monitoring)

                  Well, if all the patches were applied correctly AND you made a fresh build
                  after cleaning the port folder, you should have had lines related to
                  event.h both in your configure.log and config.h.


                  [patches:#106] Support for the BSD family (kqueue-based monitoring)

                  Status: open
                  Created: Mon Nov 11, 2013 10:48 PM UTC by hedger Last Updated: Sun
                  Dec 15, 2013 05:18 PM UTC
                  Owner: nobody

                  I've implemented a kqueue/kevent-based filesystem polling. Tested on FreeBSD
                  9.1-RELEASE amd64.
                  Also avaliable at my github
                  page
                  .


                  Sent from sourceforge.net because you indicated interest in
                  https://sourceforge.net/p/minidlna/patches/106/

                  To unsubscribe from further messages, please visit
                  https://sourceforge.net/auth/subscriptions/

                   

                  Related

                  Patches: #106

                • Mark Thompson

                  Mark Thompson - 2013-12-16

                  Fixed the problem. When I was using 'make install' well there is so much
                  data there that I didn't see the smoking gun. Automake is required to
                  compile this and all I did was all the package. Now it's working, meaning
                  the files.db are updated immediately upon a change. There is no delay which
                  is what I'd have expected the 'notify_interval=120' value to have achieved.
                  But it at least works so I'm happy about that.

                  Thanks,
                  Mark

                  -----Original Message-----
                  From: hedger [mailto:tehhedger@users.sf.net]
                  Sent: Sunday, December 15, 2013 3:49 PM
                  To: [minidlna:patches]
                  Subject: [minidlna:patches] Re: #106 Support for the BSD family
                  (kqueue-based monitoring)

                  Well, if all the patches were applied correctly AND you made a fresh build
                  after cleaning the port folder, you should have had lines related to
                  event.h both in your configure.log and config.h.


                  [patches:#106] Support for the BSD family (kqueue-based monitoring)

                  Status: open
                  Created: Mon Nov 11, 2013 10:48 PM UTC by hedger Last Updated: Sun
                  Dec 15, 2013 05:18 PM UTC
                  Owner: nobody

                  I've implemented a kqueue/kevent-based filesystem polling. Tested on FreeBSD
                  9.1-RELEASE amd64.
                  Also avaliable at my github
                  page
                  .


                  Sent from sourceforge.net because you indicated interest in
                  https://sourceforge.net/p/minidlna/patches/106/

                  To unsubscribe from further messages, please visit
                  https://sourceforge.net/auth/subscriptions/

                   

                  Related

                  Patches: #106

              • hedger

                hedger - 2013-12-15

                Well, if all the patches were applied correctly AND you made a fresh build after cleaning the port folder, you should have had lines related to event.h both in your configure.log and config.h.

                 
  • hedger

    hedger - 2013-12-15

    wrong thread, deleted

     
    Last edit: hedger 2013-12-15
  • Douglas Carmichael

    When I use minidlna with the kqueue patch on FreeBSD 10.0-RELEASE, it starts up properly and responds to directory changes but it doesn't clean up properly upon a Ctrl-C or shutting down the system.

    (Thus blocking an orderly shutdown.)

    The message I see is:
    [2014/02/08 12:28:07] inotify.c:859: warn: kevent polling failure: Interrupted system call
    Then it hangs.

    When I did a backtrace with gdb, it seems to stop on the kevent loop:
    Program received signal SIGINT, Interrupt.
    [Switching to Thread 807006c00 (LWP 100365/minidlnad)]
    0x00000008026320ea in kevent () from /lib/libc.so.7
    (gdb) where
    0 0x00000008026320ea in kevent () from /lib/libc.so.7
    1 0x000000000042d154 in start_kqueue () at inotify.c:857
    2 0x00000008023004a4 in pthread_create () from /lib/libthr.so.3
    3 0x0000000000000000 in ?? ()

    (gdb) frame 1

    1 0x000000000042d154 in start_kqueue () at inotify.c:857
    857 if ( kevent(global_kqueue_handle, NULL, 0, &ke, 1, NULL) == -1 )
    Current language: auto; currently minimal
    (gdb) quit

    I even tried applying the process patch (https://sourceforge.net/p/minidlna/patches/112/) and it has no effect.

    Would anyone have any idea of the cause of this issue, and a possible solution?

     

Log in to post a comment.