Amiga.org

Amiga computer related discussion => Amiga Software Issues and Discussion => Topic started by: flaviosr on February 06, 2011, 09:48:44 PM

Title: Samba and SMBFS...
Post by: flaviosr on February 06, 2011, 09:48:44 PM
Hi to all,
I configured Samba and it's ok! I can ping, the Amiga is seen and the sun is shining... :-)
But when I try to use SMBFS I have some problems:
° I made small scripts to "see" some PCs but only few times these scripts works... most of the times nothing happens and some the computer hangs;
° if I copy these scripts in a CLI shell everything is ok!
ARGH!!! What am I missing?

Another help: is it possible to disconnect a connection? If I stop Miami while a connection is on, the computer hangs most of the times...

Thanx
Title: Re: Samba and SMBFS...
Post by: doctorq on February 06, 2011, 09:56:08 PM
I'm mounting SMBFS shares fine through scripts, so can you give an example of your script that doesn't work?

FYI, you actually don't need Samba installed for using SMBFS.

As for stopping a share, RTFM. Write Status in CLI to see which process you have to break, and then write Break to break the connection.
Title: Re: Samba and SMBFS...
Post by: Piru on February 06, 2011, 09:57:51 PM
smbfs needs stack of at least 32768 bytes.
You can disconnect by sending CTRL-C to smbfs process.
Title: Re: Samba and SMBFS...
Post by: flaviosr on February 07, 2011, 06:50:14 PM
Quote from: doctorq;613313
I'm mounting SMBFS shares fine through scripts, so can you give an example of your script that doesn't work?

FYI, you actually don't need Samba installed for using SMBFS.

As for stopping a share, RTFM. Write Status in CLI to see which process you have to break, and then write Break to break the connection.


My script is very easy, changed today to the following line:
RUN SMBFS Volume="name volume" Workgroup=WORKGROUP Service=//computer/directory

I also changed stack to 32768...

Most of the times it hangs and only some it works... :(
First I had also >nil: but without it I can CTLR+C to stop! :)

If I copy the line to a CLI line everything works always (apart my CTRL+C problem... if I close this way the PC hangs...).

Since I am not so good in AmigaOS:
° I created the file with editpad and saved it;
° I opened the info for the file;
° I have the "V" (I do not know the word in English!) for script and removed the one for executable;
° I changed the stack today to 32768;
° Priority 0???
° Have I to executo from Workbench? Now I have this doubt... is it better to run from CLI?
° I change the association from editpad to iconx...

anf, anf, anf...

Where am I wrong?
Title: Re: Samba and SMBFS...
Post by: doctorq on February 07, 2011, 07:16:14 PM
I can't tell you were you are going wrong, but for me, it works by either starting the script from an icon or starting the script from CLI.

I always use Run >NIL: to start it, as I don't want to have 4 open windows telling me the same thing, for the 4 shares I usually mount. If I really need to disconnect one of the drives, I use the break command instead.

I have the following text in one of my script files.

Run >NIL: C:SMBFS Workgroup=MSHOME User=PCGuest Service=//Desktop/Amiga Device=Amiga_SHARE: volume="Amiga on Desktop"

I use StackAttack, so the stack size is taken care of automatically. I use version 1.66 of SMBFS.
Title: Re: Samba and SMBFS...
Post by: Piru on February 07, 2011, 07:23:30 PM
Quote from: doctorq;613603
I use StackAttack, so the stack size is taken care of automatically.
You really waste 32k stack for each and every process? Sounds like huge waste to me.
Title: Re: Samba and SMBFS...
Post by: doctorq on February 07, 2011, 07:28:35 PM
And yet, I still have more than 200 MB free fast ram left, so I can live with it :-)
Title: Re: Samba and SMBFS...
Post by: olsen on February 07, 2011, 07:33:31 PM
Quote from: flaviosr;613310
Hi to all,
I configured Samba and it's ok! I can ping, the Amiga is seen and the sun is shining... :-)
But when I try to use SMBFS I have some problems:
° I made small scripts to "see" some PCs but only few times these scripts works... most of the times nothing happens and some the computer hangs;
° if I copy these scripts in a CLI shell everything is ok!
ARGH!!! What am I missing?


Are you sure that everything always works if you launch smbfs manually?

There's a potential issue with name resolution. If you don't have a DNS entry set up for each server you want to connect to, smbfs will fall back to sending broadcast name queries through the network in the hope that the server you want to connect to will respond. This may not always work. In fact, depending upon your TCP/IP stack it may not work at all. The reason why it may not work is because the TCP/IP stack may not be able to send the broadcast query to the right place due to a bug in the old TCP/IP code.

Anyway, a workaround for this name resolution issue is to use the IPv4 address of the server instead of trying its name.

So... the next question would be: how do you launch smbfs if you don't enter the command manually?
Title: Re: Samba and SMBFS...
Post by: motorollin on February 07, 2011, 08:33:26 PM
Quote from: Piru;613605
You really waste 32k stack for each and every process? Sounds like huge waste to me.


Quote from: doctorq;613607
And yet, I still have more than 200 MB free fast ram left, so I can live with it :-)


But it's the principle!

--
moto
Title: Re: Samba and SMBFS...
Post by: doctorq on February 07, 2011, 10:25:44 PM
Quote from: motorollin;613617
But it's the principle!


Again, four chunks of 32k really can't piss me off.
Title: Re: Samba and SMBFS...
Post by: Golem!dk on February 08, 2011, 02:31:20 PM
Quote from: doctorq;613665
Again, four chunks of 32k really can't piss me off.


So you only have four active processes at any given time? :)
Title: Re: Samba and SMBFS...
Post by: pVC on February 08, 2011, 02:59:23 PM
For breaking certain smbfs mount I use this script (launched from dopus startmenu):

status com "smbfs '//remotesystem/share'" > T:smbfs_pid
break ? < T:smbfs_pid >NIL:
Title: Re: Samba and SMBFS...
Post by: flaviosr on February 08, 2011, 09:20:59 PM
Quote from: olsen;613608
Are you sure that everything always works if you launch smbfs manually?

There's a potential issue with name resolution. If you don't have a DNS entry set up for each server you want to connect to, smbfs will fall back to sending broadcast name queries through the network in the hope that the server you want to connect to will respond. This may not always work. In fact, depending upon your TCP/IP stack it may not work at all. The reason why it may not work is because the TCP/IP stack may not be able to send the broadcast query to the right place due to a bug in the old TCP/IP code.

Anyway, a workaround for this name resolution issue is to use the IPv4 address of the server instead of trying its name.

So... the next question would be: how do you launch smbfs if you don't enter the command manually?


Bad news (for me)... I made more tests and SMBFS hangs also when launched from CLI but not so often when lauched with a script!
I tried with IP address instead than name but I had no results!
I tried passing from SMBFS 1.74 to the older 1.66 but again no results.
If I use device and service together the Amiga hangs immediately!!!
When I launch a script nothing happens... but if I open a CLI and try to "enter" the new device I receive a memory error!!! :-o
I am using a standard 18 Mb A4000T, could it be not powerful enough?

Another question: are you using Miami or Genesis?
Which is better?
Title: Re: Samba and SMBFS...
Post by: motorollin on February 09, 2011, 04:09:26 PM
Quote from: doctorq;613665
Again, four chunks of 32k really can't piss me off.


Clearly text alone is insufficient to communicate sarcasm ;)
Title: Re: Samba and SMBFS...
Post by: Daedalus on February 09, 2011, 04:44:40 PM
Shameless plug here, but you could try my little GUI for SMBFS (Aminet clicky! (http://aminet.net/package/comm/net/SMBMounter))... It runs as a commodity, tracks your shares and allows you to mount and dismount them at a click. It doesn't use encryption and passwords are plain to see when you configure it, so it's not for the security-conscious, but it might make things a little easier for you.

I use it all the time and it works great for me, but I use it on OS4 with Roadshow. From my OS3.9 days though, I found that AmiTCP/Genesis to be faster for Samba transfers and general use. Miami of course was much more flexible and so was my only option when connection to some unusual networks.
Title: Re: Samba and SMBFS...
Post by: jj on February 09, 2011, 04:50:30 PM
Should work fine on MoprhOS as well im guessing?
Title: Re: Samba and SMBFS...
Post by: Daedalus on February 09, 2011, 06:15:30 PM
@JJ
I haven't tried it myself (no MorphOS box) - apparently there's a null pointer somewhere which OS3 and 4 are happy to ignore but MorphOS gives out about, but I haven't been able to find it and it works fine apart from that... Let me know if it works for you! :)
Title: Re: Samba and SMBFS...
Post by: jj on February 10, 2011, 10:11:00 AM
Will try and give it a whril over the weekend
Title: Re: Samba and SMBFS...
Post by: Tempest on February 10, 2011, 11:14:58 AM
I'm using SMB-Connect (http://aminet.net/package/comm/tcp/smbcn105) to mount SMB shares, works very well.

Wow, I didn't realise that stackattack gives every process 32k stack. I just checked it with Scout and indeed every process started after stackattack auto has a stack of 32k, what a waste, needless to say I removed it.
Title: Re: Samba and SMBFS...
Post by: olsen on February 10, 2011, 08:07:20 PM
Quote from: flaviosr;614107
Bad news (for me)... I made more tests and SMBFS hangs also when launched from CLI but not so often when lauched with a script!


Well, at least there's some consistency now. I'd be mighty surprised if the thing worked one way or not the other. From what I know, this sort of thing either works, or it doesn't, regardless of where or when you launch it.

Quote

I tried with IP address instead than name but I had no results!


Ouch. Does the server you want to connect to have a regular name? If so, does the server's own name, as reported by Samba, match it?

Quote

I tried passing from SMBFS 1.74 to the older 1.66 but again no results.


Generally, the newer versions have drastically fewer bugs and show less wacky and unpredictable behaviour. I recommend you try the newer version.

Quote

If I use device and service together the Amiga hangs immediately!!!
When I launch a script nothing happens... but if I open a CLI and try to "enter" the new device I receive a memory error!!! :-o
I am using a standard 18 Mb A4000T, could it be not powerful enough?


Honestly, this sounds rather bizarre. Does your Amiga crash or lock up in connection with the TCP/IP stack, or does it take smbfs to make trouble?

When did you last test your system's memory? Easy way to make a memory test: copy data from your hard disk into RAM-Disk until either RAM-Disk fills up, or your system crashes. If your system crashes before it fills up, you might want to see to those SIMMs.

Quote

Another question: are you using Miami or Genesis?


Um, neither :)

Quote

Which is better?


Depends upon what you're doing. Miami tends to be slower than Genesis. But Miami's GUI may arguably be a better design.
Title: Re: Samba and SMBFS...
Post by: flaviosr on February 20, 2011, 06:54:32 PM
Quote from: olsen;614693
Well, at least there's some consistency now. I'd be mighty surprised if the thing worked one way or not the other. From what I know, this sort of thing either works, or it doesn't, regardless of where or when you launch it.



Ouch. Does the server you want to connect to have a regular name? If so, does the server's own name, as reported by Samba, match it?

This is correct... and the problem is that NOT ALWAYS I have problems...


Quote from: olsen;614693
Generally, the newer versions have drastically fewer bugs and show less wacky and unpredictable behaviour. I recommend you try the newer version.

You are right... I am going to pass again to the newer version (I want to add anyway that I cannot use Picasso96 rev "c" and I have to use rev "b"!!! :-) ...)


Quote from: olsen;614693
Honestly, this sounds rather bizarre. Does your Amiga crash or lock up in connection with the TCP/IP stack, or does it take smbfs to make trouble?

Imagine how I feel!!! :(((
The Amiga lock up... never crashed...
I tried different amounts of stack but I notice no differences...

Quote from: olsen;614693
When did you last test your system's memory? Easy way to make a memory test: copy data from your hard disk into RAM-Disk until either RAM-Disk fills up, or your system crashes. If your system crashes before it fills up, you might want to see to those SIMMs.

I will try but I have the same problem in two different Amigas... :(


Quote from: olsen;614693
Depends upon what you're doing. Miami tends to be slower than Genesis. But Miami's GUI may arguably be a better design.

I am thinking about the Amiga that I am using for tests... a "poor" A4000T with 68040@25... could it be that it needs time for the Amiga to be "connected" to my intranet? For example, even with fast PC, it takes a bit of time before other PCs are seen... perhaps simply the Amiga hangs instead than waiting for the connection to be extablished.

I am going to test the memory (always a good thing) and trying also Genesis that you tell it's faster... and also waiting for some time before asking for a connection...

Other suggestions?
Title: Re: Samba and SMBFS...
Post by: nicholas on February 20, 2011, 07:05:17 PM
Quote from: Tempest;614604
I'm using SMB-Connect (http://aminet.net/package/comm/tcp/smbcn105) to mount SMB shares, works very well.

Wow, I didn't realise that stackattack gives every process 32k stack. I just checked it with Scout and indeed every process started after stackattack auto has a stack of 32k, what a waste, needless to say I removed it.


Is that Stackattack2 you are using?
Title: Re: Samba and SMBFS...
Post by: Tempest on February 20, 2011, 07:09:55 PM
Quote from: nicholas;616771
Is that Stackattack2 you are using?


It was indeed Stackattack2 I was using.
Title: Re: Samba and SMBFS...
Post by: olsen on February 21, 2011, 01:01:51 PM
Quote from: flaviosr;616770
I am thinking about the Amiga that I am using for tests... a "poor" A4000T with 68040@25... could it be that it needs time for the Amiga to be "connected" to my intranet? For example, even with fast PC, it takes a bit of time before other PCs are seen... perhaps simply the Amiga hangs instead than waiting for the connection to be extablished.


No, this isn't likely. The reason why the servers do not appear instantly is because they report their status at irregular intervals, and this information is collected and resent at irregular intervals, too, by the server which assumed responsibility for the network.

This is not a matter of speed or anything.

When you tell smbfs to connect to a server, it will first try to resolve the name of the server through a DNS (domain name system) lookup. If you do not run a local DNS server, then this lookup will probably fail. After it has failed, smbfs will repeat the lookup, but this time use a different query method which should work within the Samba/Windows network domain. This can fail, too, if the TCP/IP stack swallows the query packet sent.

What you see is probably the DNS lookup timing out and the second query attempt not always working.

Quote

I am going to test the memory (always a good thing) and trying also Genesis that you tell it's faster... and also waiting for some time before asking for a connection...

Other suggestions?


Here's what I used to do: I set the IP address of the Samba (or Windows) server to a fixed number and then edited the Amiga's host name database to map it to a predefined name. In AmiTCP that database is a file called "AmiTCP:db/hosts", and I think you can manually edit the database in Miami.

Anyway, you'd put the fixed IP address there and the name of the server you picked. To access the server thruough smbfs, you'd use thsi predefined server name you added to the hosts database. This has the effect of the DNS lookup always succeeding.