Trouble Mapping multiple network drives
  • Just looking around
    stylon
    Posts: 11 from 2018/4/19
    From: UK
    Hoping somebody can help me with this one please. I've got a NAS box with various shares that I need to connect to. I've found instructions on how to do it and have added them to my user-network-startup file.

    Problem is I have 4 shares to map and it never maps them all on boot. Sometimes I'll only get 1 mapped or sometimes 2 but never all 4. I've tested each mapping using the shell and they map fine if done manually that way. Feel like I'm missing something?

    here's an example line of code that maps my music share:

    Run >NIL: SmbFS WORKGROUP=lyonsden USER=steve PASSWORD=******** VOLUME=Music: SERVICE=//Enterprise/music

    Thanks
    Power Mac G4 - 1.25Ghz - MorphOS 3.10
    Amiga 500 - 68080 - Vampire V500 V2
    C64 - SIDFX - 1541 Ultimate II+

    https://lyonsden.net
  • »03.05.18 - 15:58
    Profile Visit Website
  • MorphOS Developer
    jacadcaps
    Posts: 1650 from 2003/3/5
    From: Canada
    Try to log the output to files and see what the errors are. Maybe you just need to make a loop that retries on failures.
  • »03.05.18 - 17:03
    Profile Visit Website
  • Order of the Butterfly
    Order of the Butterfly
    KennyR
    Posts: 320 from 2003/3/4
    From: #AmigaZeux, Gu...
    Quote:

    Problem is I have 4 shares to map and it never maps them all on boot. Sometimes I'll only get 1 mapped or sometimes 2 but never all 4. I've tested each mapping using the shell and they map fine if done manually that way. Feel like I'm missing something?


    If you do the mapping in a script and execute it in the shell, does it do the same thing as it does in user-network-startup?
  • »03.05.18 - 18:17
    Profile
  • Order of the Butterfly
    Order of the Butterfly
    KennyR
    Posts: 320 from 2003/3/4
    From: #AmigaZeux, Gu...
    If I were to guess I'd say you're falling foul of a Samba security feature to prevent connection flooding, so it ignores what it can't take. But that'd only be guess.
  • »03.05.18 - 18:25
    Profile
  • Just looking around
    stylon
    Posts: 11 from 2018/4/19
    From: UK
    Thanks for the suggestions guys - I only installed MorphOS for the first time ever a couple of weeks ago so I'm struggling a bit with what I can and can't figure out how to do.

    I don't know how to log the output to a file nor get it to loop if something fails...

    I did manage to figure out how to create a script and run it from the shell though. Annoyingly when I run it this way it connects all 4 drives almost instantly, first time, every time. I 'ejected' all the mapped drives and ran the script again (several times) to make sure.

    Not sure what this means or how it helps my cause though?

    Thanks.
    Power Mac G4 - 1.25Ghz - MorphOS 3.10
    Amiga 500 - 68080 - Vampire V500 V2
    C64 - SIDFX - 1541 Ultimate II+

    https://lyonsden.net
  • »04.05.18 - 08:39
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 1766 from 2003/2/24
    Quote:

    stylon wrote:

    I did manage to figure out how to create a script and run it from the shell though. Annoyingly when I run it this way it connects all 4 drives almost instantly, first time, every time. I 'ejected' all the mapped drives and ran the script again (several times) to make sure.



    For me (don't use SAMBA...) it suggest that network wasn't reliable "up" when the shares got mounted at startup.

    Wether that is a bug (script getting executed premature) or you f###ing up something is beyond me....
    --------------------- May the 4th be with you ------------------
    Mother Russia dance of the Zar, don't you know how lucky you are
  • »04.05.18 - 09:31
    Profile
  • MorphOS Developer
    geit
    Posts: 915 from 2004/9/23
    When you want to run your script on startup, add execution to s:user-network-startup.

    This way it is guaranteed the network is there, when running the script.

    smbfs does not wait for network to be up or a device to simply respond. For all network related stuff you want to run automatically on boot, you have to run from s:user-network-startup by using "execute s:MySMBFS.script" or so.
  • »04.05.18 - 09:46
    Profile
  • Just looking around
    stylon
    Posts: 11 from 2018/4/19
    From: UK
    Quote:

    Kronos wrote:
    Wether that is a bug (script getting executed premature) or you f###ing up something is beyond me....


    Thanks for the words of encouragement.

    Script getting run too soon did give me an idea though - I put a 'wait 10' command into the startup script just before the drives are mapped and although there is obviously a delay now, all 4 drives do get mapped succesfully after every boot. Will still tweak the wait time to get it as small as possible but otherwise problem solved.
    Power Mac G4 - 1.25Ghz - MorphOS 3.10
    Amiga 500 - 68080 - Vampire V500 V2
    C64 - SIDFX - 1541 Ultimate II+

    https://lyonsden.net
  • »04.05.18 - 09:55
    Profile Visit Website
  • MorphOS Developer
    geit
    Posts: 915 from 2004/9/23
    Don´t use a delay, use s:user-network-startup and it is as fast as possible.
  • »04.05.18 - 09:57
    Profile
  • Just looking around
    stylon
    Posts: 11 from 2018/4/19
    From: UK
    Quote:

    geit wrote:

    When you want to run your script on startup, add execution to s:user-network-startup.

    This way it is guaranteed the network is there, when running the script.

    smbfs does not wait for network to be up or a device to simply respond. For all network related stuff you want to run automatically on boot, you have to run from s:user-network-startup by using "execute s:MySMBFS.script" or so.




    Hi, thanks - I did actually have my mapping commands in the user-network-startup already which is why it was strange that they didn't seem to work reliably. However as I just mentioned above I have added a small delay before they are run now and this seems to have worked.
    Power Mac G4 - 1.25Ghz - MorphOS 3.10
    Amiga 500 - 68080 - Vampire V500 V2
    C64 - SIDFX - 1541 Ultimate II+

    https://lyonsden.net
  • »04.05.18 - 10:00
    Profile Visit Website
  • jPV
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jPV
    Posts: 1404 from 2003/2/24
    From: po-RNO
    You could also use the WaitX command, to run your command lines delayed, but without delaying the rest of the startup script(s) (which happens if you use the normal Wait command).

    For example:
    Run >NIL: WaitX S=5 Run >NIL: SmbFS WORKGROUP=lyonsden USER=steve PASSWORD=******** VOLUME=Music: SERVICE=//Enterprise/music

    (not sure if you need the second "Run >NIL:" with the SmbFS anymore in this case, but doesn't hurt either)

    You could also change the S value (seconds) a bit for each mount so that they won't get executed at the same time.


    [ Edited by jPV 04.05.2018 - 12:25 ]
  • »04.05.18 - 10:13
    Profile Visit Website
  • Moderator
    Kronos
    Posts: 1766 from 2003/2/24
    Quote:

    geit wrote:

    This way it is guaranteed the network is there, when running the script.




    This seems not to be working reliable aka a bug.....
    --------------------- May the 4th be with you ------------------
    Mother Russia dance of the Zar, don't you know how lucky you are
  • »04.05.18 - 10:31
    Profile
  • jPV
  • Paladin of the Pegasos
    Paladin of the Pegasos
    jPV
    Posts: 1404 from 2003/2/24
    From: po-RNO
    Quote:

    stylon wrote:
    I don't know how to log the output to a file nor get it to loop if something fails...


    ...and logging output to a file would happen if you change the output forwarding (>) to some other location than NIL: (similar to /dev/null or other device which just discards any writes).

    For example:
    Run >RAM:smbfs-musicmount.txt SmbFS WORKGROUP=lyonsden USER=steve PASSWORD=******** VOLUME=Music: SERVICE=//Enterprise/music
  • »04.05.18 - 10:36
    Profile Visit Website
  • Just looking around
    stylon
    Posts: 11 from 2018/4/19
    From: UK
    Quote:

    jPV wrote:
    ...and logging output to a file would happen if you change the output forwarding (>) to some other location than NIL: (similar to /dev/null or other device which just discards any writes).

    For example:
    Run >RAM:smbfs-musicmount.txt SmbFS WORKGROUP=lyonsden USER=steve PASSWORD=******** VOLUME=Music: SERVICE=//Enterprise/music



    Thank you - didn't know about the WaitX command - that's a much more elegant solution. I've amended my script to use this now and staggered the times too. Quite like the resulting effect of my drives each appearing on my desktop one after the other like magic!

    Thanks for explaining about how to log output to a file too - that will help me a lot in the future :-)

    [ Edited by stylon 04.05.2018 - 10:44 ]
    Power Mac G4 - 1.25Ghz - MorphOS 3.10
    Amiga 500 - 68080 - Vampire V500 V2
    C64 - SIDFX - 1541 Ultimate II+

    https://lyonsden.net
  • »04.05.18 - 10:43
    Profile Visit Website