Samba inotify events - Samba

This is a discussion on Samba inotify events - Samba ; Hi Folks, I'm deploying a Samba (3.0.24-6etch10) server into an environment where users will copy files onto it. When a file arrives, I make a backup copy out of sight. To achieve this, I'm watching inotify events. Samba generates a ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Samba inotify events

  1. Samba inotify events

    Hi Folks,

    I'm deploying a Samba (3.0.24-6etch10) server into an environment where
    users will copy files onto it. When a file arrives, I make a backup copy
    out of sight.

    To achieve this, I'm watching inotify events.

    Samba generates a flurry of them for all the event types I have watched.
    For example:
    rm file over samba (smbclient) produces: OPEN,ISDIR then
    CLOSE_NOWRITE,CLOSE,ISDIR then DELETE
    on the file system directly, rm products: DELETE

    In addition, an identical file transfer will produce unpredictable,
    repeated events.

    I can understand that Samba performs housekeeping through the OS so more
    file events may be observed. Unpredictable, repeated events, are a pain
    though.

    Are there any configuration tweaks which may help improve the
    predictability of the events I observe through Samba?

    Thanks for your time;
    richard


  2. Re: Samba inotify events

    On Wed, Jul 02, 2008 at 10:43:53AM +0000, Richard Henwood wrote:
    > Are there any configuration tweaks which may help improve the
    > predictability of the events I observe through Samba?


    Probably not, sorry. We generate file system actions on a
    client's behalf, and the specific syscalls we do fully
    depends on what the client asks us to do.

    Volker

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.5 (GNU/Linux)

    iD8DBQFIa11YUzqjrWwMRl0RAhbdAJoCeAejPDfeRKee1kCFmp WYl5OB2gCeIWU5
    l4oiK8QpQz0Aj6Fj8/4A8yw=
    =RYug
    -----END PGP SIGNATURE-----


  3. Re: Samba inotify events

    On Wed, 02 Jul 2008 12:50:00 +0200, Volker Lendecke wrote:

    > On Wed, Jul 02, 2008 at 10:43:53AM +0000, Richard Henwood wrote:
    >> Are there any configuration tweaks which may help improve the
    >> predictability of the events I observe through Samba?

    >
    > Probably not, sorry. We generate file system actions on a client's
    > behalf, and the specific syscalls we do fully depends on what the client
    > asks us to do.
    >


    ah! of course! So because I can expect a number of clients to use the
    service, I think I should be taking the 'inotify' events as a indicator
    that something has happened and do my housekeeping further up the
    application.

    Thanks!
    richard


  4. Re: Samba inotify events

    On Wed, Jul 02, 2008 at 10:43:53AM +0000, Richard Henwood wrote:
    >>>Are there any configuration tweaks which may help improve the
    >>>predictability of the events I observe through Samba?


    Not specifically via the built-in inotify, but there are hooks
    for doing actions on connect/disconnect from a share, such as

    postexec (S)

    This option specifies a command to be run whenever the service is
    disconnected. It takes the usual substitutions. The command may be
    run as the root on some systems.

    An interesting example may be do unmount server resources:
    postexec = /etc/umount /cdrom

    See also preexec.

    Default: none (no command executed)

    Example: postexec = echo "%u disconnected from %S from %m (%I)" >> /tmp/log

    --dave
    --
    David Collier-Brown, | Always do right. This will gratify
    System Programmer and Author | some people and astonish the rest
    davecb@spamcop.net | -- Mark Twain
    (416) 223-5943


+ Reply to Thread