Umounting a samba share after a certain time - SMB

This is a discussion on Umounting a samba share after a certain time - SMB ; Hi all, I use preexec and postexec in order to mount & umount the floppy drive for a small network. I want to know from you guys, if there is a command to umount the floppy automatically after a certain ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: Umounting a samba share after a certain time

  1. Umounting a samba share after a certain time

    Hi all,

    I use preexec and postexec in order to mount & umount the floppy drive
    for
    a small network.

    I want to know from you guys, if there is a command to umount the
    floppy automatically after a certain time, say 300 secs?

    As far as I understood from my samba book about postexec, it is
    capable to umount
    a share !ONLY! if the user logs out.

    Or would it be better to write a small script which would be executed
    per click on the samba server from the client?

    Thanx in advance,
    Umut

  2. Re: Umounting a samba share after a certain time

    jsbach wrote:

    > Hi all,
    >
    > I use preexec and postexec in order to mount & umount the floppy drive
    > for
    > a small network.
    >
    > I want to know from you guys, if there is a command to umount the
    > floppy automatically after a certain time, say 300 secs?
    >

    man smb.conf
    /deadtime

    > As far as I understood from my samba book about postexec, it is
    > capable to umount
    > a share !ONLY! if the user logs out.
    >

    "deadtime" only works if the number of open files from that client
    approaches zero. It cannot be guaranteed in a windows client world,
    however: one explorer hickup and the file stays open for samba. Take a look
    at smbstatus at evening when all clients have disconnected. Most of the
    time there are still some leftover locks.

    > Or would it be better to write a small script which would be executed
    > per click on the samba server from the client?
    >

    A fake share with a root preexec command "kill this client's smbd session"
    would be useful.

    --
    Longhorn error#4711: TCPA / NGSCB VIOLATION: Microsoft optical mouse
    detected penguin patterns on mousepad. Partition scan in progress
    *to*remove*offending*incompatible*products.**React ivate*your*MS*software.
    Linux woodpecker.homnet.at 2.6.8reiser4pkt*[LinuxCounter#295241]

  3. Re: Umounting a samba share after a certain time


    "jsbach" wrote in message
    news:dec589c4.0409240308.1b1c6e1f@posting.google.c om...
    > Hi all,
    >
    > I use preexec and postexec in order to mount & umount the floppy drive
    > for
    > a small network.
    >
    > I want to know from you guys, if there is a command to umount the
    > floppy automatically after a certain time, say 300 secs?


    There is the auto-mounting facility, which reads /etc/auto.master and files
    that that points for a list of mountable locations. That's normally used for
    NFS mounting, but I assume it can work for SMB.

    Alternatively, you could set up a cron job in /etc/cron.d/ to probe the
    mount point and see if its held open by anything with the "fuser -m"
    command, although I've never tried that with SMB mounts, and then unmount it
    if it's not active.

    > As far as I understood from my samba book about postexec, it is
    > capable to umount
    > a share !ONLY! if the user logs out.
    >
    > Or would it be better to write a small script which would be executed
    > per click on the samba server from the client?


    The cron job might be easier.



  4. Re: Umounting a samba share after a certain time


    "Walter Mautner" wrote in message
    news:52jf22-4nq.ln1@ID-104681.user.uni-berlin.de...
    > jsbach wrote:
    >
    > > Hi all,
    > >
    > > I use preexec and postexec in order to mount & umount the floppy drive
    > > for
    > > a small network.
    > >
    > > I want to know from you guys, if there is a command to umount the
    > > floppy automatically after a certain time, say 300 secs?
    > >

    > man smb.conf
    > /deadtime
    >
    > > As far as I understood from my samba book about postexec, it is
    > > capable to umount
    > > a share !ONLY! if the user logs out.
    > >

    > "deadtime" only works if the number of open files from that client
    > approaches zero. It cannot be guaranteed in a windows client world,
    > however: one explorer hickup and the file stays open for samba. Take a

    look
    > at smbstatus at evening when all clients have disconnected. Most of the
    > time there are still some leftover locks.


    Ouch. That's nasty.



+ Reply to Thread