Reconnect: ~~~~~~~~~~ If the server machine is rebooted, NetFS will automatically reconnect to it when it is running again. However, there may be long timeouts after a connection failure before NetFS gives up. This is a normal for the TCP protocol that NetFS uses for its connections.
Sometimes NetFS may lose the connection to the server machine so that it doesn't automatically try to reconnect. In that case, you can try to reconnect by using the DiskChange-command.
You can also force NetFS to close the connection by sending ACTION_DIE packet to it (for example with the 'die'-command that comes with MSH).
When the remote host isn't reachable anymore, it seems to leave the handler in a state leading to doslist lock too (which explains why the whole workbench or asl requesters and so on are locked too). Fortunately, you can still break smbfs process (ctrl-c).
@amije I read the doc and I even contact the author. I didn't try the die command from the msh package before today.
The die command does not seems to function properly on OS4, and cannot function while the system is freezed (fab has written that in fact it's the doslist which is locked)
'Assign XXX dismount' can be run but does'nt eject the shared device.
I'm trying to create a script which on first double-click : - ping the remote computer - if reachable, then script mount the share otherwise it shows an alert - while running the script test every 10 sec if the remote computer is still reachable. if not, the script eject the share (well, this is where i'm stuck)
If everything goes fine and you have finished with the remote computer. Second double-click dismount the share in a clean way.
So currently the script is working well until the remote computer is un-reachable.
@Fab Do you know by any chance a way to get out of the 'doslist lock' situation?
Unlike smbfs, NetFS cannot be killed as the process is run on the remote computer.
the problem is that netfs is very old and 68k. have you try other methods, ftp for example? you can set ftpd in os4 tcp to act as a server, and run a client ftp on the other side.
Yes, I also use others ways too (mostly Samba, a bit ftp) but AmiNetFS has advantages too (faster, more Amiga, etc.). And to be honest, the fact that it get 'stuck' is not a big problem. You just have to think to dismount the remote device before switching off the computer.
The Dismount command does a more thorough cleanup than Assign DISMOUNT. It attempts to shut down the filesystem in question, while Assign DISMOUNT only removes the Doslist entry.
There is also a FORCE option, but do read the doc before using it.
nbache wrote: @JCC The Documentation drawer is your friend ...
Real men don't read instructions - Or - If all else fails, read instructions. Note, I said "read", not "follow"
Normally I use it only to reference a shell command or configuration issue, I should "curl up" with the documentation drawer and see what else I've missed.
Anyway. I was looking for some automated process to (dis)mount shares myself for some time and didn't really find a (always) working solution (that was already available and didn't involve third-party software).
Tested with Linux, Windumb and two NAS (FritzBox and Synology) shares.
Pros: - Start options to use one script for all possible shares - Configurable (the longer the delay time the longer it takes to get the system back from a dismounted share, i found that 10-15 seconds are bearable) - (Dis)mounts shares on-the-fly - Can be used in network-startup (i'm using it from there) - Short - Doesn't strain the system (at least, not for me)
Cons: - Tested solely on an X1000 (with afore mentioned destination machines), so if anyone want to give it a go (with other NAS/shares/destination machine etc.) be my guest. - Works only with sambav1 on the destination machine (smbfs limitation) - If the share goes offline while there is disk access (read/write), Workbench will crash (at least, for me) - Speed depends on the connection of the destination machine (e.g. my Synology NAS is slower than my Windumb PC, though both are connected directly into the router with a LAN cable) - Changing the CACHE (or buffers) only impacts in directory scanning, all other speeds stay the same (more or less) -> tested with DiskSpeed on all destination shares, thus i went back to use it with the same setting all my other HDDs use, feel free to change.
Here's the script:
/*
MonitorShare.rexx
Monitors and automatically (dis)mounts samba shares
Options:
v_address - LAN Address of the machine which holds the share
v_share - Name of the share
v_user - User name that was given permission to
v_password - Password (unfortunately not obfuscated)
v_delay - number of seconds it should poll
*/
IF v_delay="" THEN DO
SAY "Error - argument(s) missing"
SAY "Usage: MonitorShare.rexx SHARE_IP SHARE_NAME USER PASSWORD SECS_POLL"
EXIT
END
p_share_mounted=0
DO FOREVER
p_address_available=0
CALL m_address_check
/*
Use smbfs's own SETENV switch to save it's process number.
*/
IF p_address_available=1 THEN DO
IF p_share_mounted=0 THEN DO
ADDRESS COMMAND 'Run >NIL: smbfs CACHE=128 MAXTRANSMIT=65535 RAISEPRIORITY TIMEOUT=10 SETENV USER='v_user' DEVICE=SMB_'v_share' VOLUME='v_share' SERVICE=//'v_address'/'v_share'/ PASSWORD='v_password
p_share_mounted=1
END
END
END
m_address_check:
/*
Checking for up and running destination.
*/
DO WHILE p_address_available=0
ADDRESS COMMAND 'ping >T:'v_share'.ping -c 3 -q 'v_address
OPEN(f_ping,'T:'v_share'.ping','R')
DO WHILE ~EOF(f_ping)
v_ping=READLN(f_ping)
IF INDEX(v_ping,'loss')>0 THEN DO
v_packet_loss=COMPRESS(SUBWORD(v_ping,7,1),'%')
LEAVE
END
END
CLOSE(f_ping)
IF EXISTS('T:'v_share'.ping') THEN
ADDRESS COMMAND 'delete quiet T:'v_share'.ping'
/*
If address is available (again), leave loop and add share.
*/
IF v_packet_loss=0 THEN DO
IF p_share_mounted=0 THEN
p_address_available=1
ELSE
ADDRESS COMMAND 'wait 'v_delay
END
ELSE DO
/*
If address is unavailable (anymore), remove share.
*/
p_address_available=0
IF p_share_mounted=1 THEN DO
/*
Destination went offline. Break process.
*/
ADDRESS COMMAND 'break ${smbfs-process/smb_'v_share'}'
p_share_mounted=0
END
ADDRESS COMMAND 'wait 'v_delay
END
END
and here's how to use it from network startup Quote:
Run >NIL: "Tools:System/Scripts/MonitorShare.rexx" 192.178.198.67 Windumb Raziel password 15
Notes:
I kept the smbfs command as simple as possible to reduce errors (one can always enhance or change it to one's needs) e.g. WORKGROUP will be handled by the server (as long as the share on it's destination was correctly added)
Now I tested NetFS revised, ver. 3.0. I have it on all AmigaOS4 and MorphOS machines.
For me it never freeze: If I poweroff remote computer, it: - on AmigaOS (Micro A1-C) disappers icon of remote disk from workbench, opened window with remote content is automatically closed. Only in assign command output is visible device netfs-peg1 ( or netfs-aone1 ). If I access this device from shell, receive warning "no disk present"
- on MorphOS (Mac Mini) Ambient icon disappears, but open window stays open, and I cannot access sub-directories. Assign command give the same result like AmigaOS.
If I power on remote computer again, desktop icons again appears without need of new mounting and I can continue with work normally.
So I recommend to install again newest NetFS version and try it again - it should't freeze. Only thing with freeze (Guru meditation) is NetFSExplorer on AmigaOS4.
Tested on two remote computers X1000/AmigaOS, Pegasos 2/MorphOS
AmigaOS3: Amiga 1200 AmigaOS4: Micro A1-C, AmigaOne XE, Pegasos II, Sam440ep, Sam440ep-flex, AmigaOne X1000 MorphOS: Efika 5200b, Pegasos I, Pegasos II, Powerbook, Mac Mini, iMac, Powermac Quad
Now I check again settings and find, that on all AmigaOS4 machines I have disabled (Active=no) server amiganetfs / Datagram in Internet Preferences.
I forgot why I disabled it, maybe this causes lockups. Try to disable it, and have enabled only server amiganetfs / Stream. Maybe there is some problem with UDP connections and timeouts, but have running only TCP (Stream) server is enough.
P.S.: if you are interested in my other NetFS settings, let me know.
AmigaOS3: Amiga 1200 AmigaOS4: Micro A1-C, AmigaOne XE, Pegasos II, Sam440ep, Sam440ep-flex, AmigaOne X1000 MorphOS: Efika 5200b, Pegasos I, Pegasos II, Powerbook, Mac Mini, iMac, Powermac Quad