LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2006, 09:38 AM   #1
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Minor Samba problem -- Connect fails during boot fstab processing, works later


Hi,

This has been bugging me for some time, so I hope someone here can suggest a better solution then I currently have: Connection "by hand".

First, let me show you the problem, and then describe the network/hardware setup, and the unique property of the problem device.

Listings and comments:

An extract from /etc/fstab showing working and problem connections (//TSS-1/R is the problem)
Code:
$ cat /etc/fstab | grep smb
//tss-1/C               /mnt/tss-1/c            smbfs   suid,workgroup=TSS,gid=linker,credentials=/root/.smbmountpasswd 0 0
//tss-1/D               /mnt/tss-1/d            smbfs   suid,workgroup=TSS,gid=linker,credentials=/root/.smbmountpasswd 0 0
//tss-1/R               /mnt/tss-1/r            smbfs   suid,workgroup=TSS,gid=linker,credentials=/root/.smbmountpasswd 0 0
When the boot process applies the /ect/fstab settings, an error message that "the connection was refused" is generated, so I added a line to the /etc/rc.d/rc.local file to retry making the connection. Here's how, and the result of the second try at connecting //TSS-1/R/ at the end of the boot process.
Code:
$ cat /etc/rc.d/rc.local | grep smb
mount /mnt/tss-1/r 2>/tmp/smb.error
$ cat /tmp/smb.error
SMB connection failed
And here's what happens after I log on:
Code:
$ sudo mount /mnt/tss-1/r
Password:
$ ls /mnt/tss-1/r
Aug-Nov 2005
Network: Standard cabled Ethernet, four nodes at 90.0.0.1-4
//TSS-1 is 90.0.0.1, a WinXP system running a firewall and internet connection.
//TSS-4 is 90.0.0.4, a Fedora 4 system, running Samba client

Unique property of //TSS-1/R: Unlike the others, //TSS-1/R is a CD-RW drive on //TSS-1.

Other things I've tried:
1) Logging in as root. Same problem.
2) Spawning a job to do the connection after five minutes from /etc/rc.d/rc.local (So a user would be logged in when the connection was attempted.) Connection still refused.
3) Forget about making the connection. Works fine, but the users complain.

So, does anyone have any idea why the connection fails during the boot, but works later?
 
Old 02-07-2006, 10:42 AM   #2
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
It is in this way to make sure the one is using the console have exclusive access to keyboard, mouse, video, sound, and the cdrom. After all, you don't want a remote user can use your cdrom to play music.
But this is a setup for a personal computer. For a server, nobody sits at console, right ?
Them you may leave the cdrom for general use.
In /etc/resmgr.conf file, comment out the line "class desktop includes cdrom". You need to restart the resource manager too.

regards,

PS: The resource manager is a bit different from a distribution to other. Adapt it for your distribution.

Last edited by marozsas; 02-07-2006 at 10:45 AM.
 
Old 02-07-2006, 02:33 PM   #3
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Interesting idea. But in this case the CD-RW is on the server, not local, and (as far as I can tell) Samba has no information about the resource connected at the WinXP end. That is (Except that it connects the device as ro, but that's, I believe, an XP limitation.), the Fedora settings for cdrom would have no effect on the smb connection.

Still, I'll try it and see what happens.

Edit: Well, that's a "bust" since I can't find any "resource manager" configuration files anywhere on my Fedora system.

Here's what I tried:
Code:
$ locate -r res[^/]*\\\.conf[^/]*$ | grep -v "/doc/" | grep -v ^/mnt | grep -v "/man/"
/etc/resolv.conf
$ locate -r man[^/]*\\\.conf[^/]*$ | grep -v "/doc/" | grep -v ^/mnt | grep -v "/man/"
/etc/man.config
$ locate -r mgr[^/]*\\\.conf[^/]*$ | grep -v "/doc/" | grep -v ^/mnt | grep -v "/man/"
$
Anyone know how (or if) Fedora implements resource management?

Edit2: Oh, I also looked in /etc/sysconfig/*, but couldn't find anything that looked helpful.

Last edited by PTrenholme; 02-07-2006 at 03:14 PM.
 
Old 02-08-2006, 04:56 AM   #4
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
I'm sorry, I missed //TSS-1 is a windows machine. My bad.
I had this problem with a Linux Server running samba and the description of the problem is almost the same. So I don't make a second reading and assumed this was the same scenario.

Sorry, but i have no ideas in this case.
 
Old 02-08-2006, 06:30 AM   #5
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
First of all, I'd like to point out that CD-RW drives contain ejectable media.
Hence, you need to remount the contents each time you insert a different CD.
On Linux, some kind of automatic mounting usually does this trick (ie umount when you eject the CD, mount when you insert
a CD).

I suppose Windows does something similar and adds a few actions, like automatically playing the CD if it's an Audio CD.
Nowadays, some Linux programs (like my Gnome CD player) do that too.

So, my question is: have you tried to see what's going on (on Windows) with the sharing when you insert a new CD in the drive? Is the sharing of the drive maintained?
Furthermore, what happens if you try to mount the shared smbfs partition but no CD is in the drive? Windows will give you a message box like "insert a CD and press any key". But how does Samba handle this? It most likely won't wait for you to put in the CD, but rather uses a time-out mechanism and exit on an error.

My final point is a question as to your purpose with all of this. Do you want to write CD's, using the drive on your Windows box, but by issuing Linux commands? That seems a little bit far-fetched to me and may cause you additional problems, like buffer underruns while burning the CD if your network slows down suddenly.
 
Old 02-08-2006, 08:09 AM   #6
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Originally Posted by timmeke
[snip]
So, my question is: have you tried to see what's going on (on Windows) with the sharing when you insert a new CD in the drive? Is the sharing of the drive maintained?
Yes, and both Samba and XP handle it with no problem.
Quote:
Furthermore, what happens if you try to mount the shared smbfs partition but no CD is in the drive?
Samba just shows an empty file system.
Quote:
[snip]
My final point is a question as to your purpose with all of this. Do you want to write CD's, using the drive on your Windows box, but by issuing Linux commands? That seems a little bit far-fetched to me and may cause you additional problems, like buffer underruns while burning the CD if your network slows down suddenly.
Actually, it's not that farfetched, since the buffering and writing is handled at the server end, and the network speed is, of course, much faster that any CD writing speed. Note that other XP systems on the network can write to the CD with no problem.

In any case, though, all I'm trying to do right now is get Samba to mount the drive when it has a CD in it. Note the last output in my initial entry, when I show the successful "by hand" mount followed by a ls of the mounted file system. That was to demonstrate that there was a CD mounted in the CD-RW.

Edit: At this point, the CD-RW is being used simply because that's the only CD drive on the server. I suspect that the problem is not, in fact, related to the -RW part, but rather to the CD part. Has anyone here "networked" a CD drive from a server to several clients?

Last edited by PTrenholme; 02-08-2006 at 08:15 AM.
 
Old 02-08-2006, 09:48 AM   #7
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
OK. I see where you are going to and you're right. It should probably work.

Have you checked the Samba logs on your Linux machine to see what goes wrong when you boot?
When Samba sais "connection failed", doesn't it write additional information in it's logfiles/the syslog?
And have you verified in Windows' event viewer that a connection is established by your Linux box?
You can also verify this via Computer Mgnt -> Shared folders for instance.

Another issue that may have an impact is the order in which the background services are started.
This is controlled by the chkconfig program on your Linux box.
Samba is clearly launched after the network has come up, otherwise the other shares would have failed too.
Altough it would surprise me that this is an issue in your case, since it should be Windows that handles
all the CD-device related stuff, not Linux.
 
Old 02-08-2006, 03:53 PM   #8
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Yes, I've checked the logs, and they all say the same thing as the message generated during the boot: "Connection refused by server."

So, why would that specific connection be refused whilst the others are accepted. (By the way, the snippet in my thread starter doesn't show it, but there are additional connections made after the "refused" one which also work fine.)

And, even stranger, why is the connection not refused later in the session?
 
Old 02-09-2006, 02:09 AM   #9
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
Quote:
Originally Posted by PTrenholme
By the way, the snippet in my thread starter doesn't show it, but there are additional connections made after the "refused" one which also work fine.
That's not uncommon. If one mount in fstab fails, the remaining mounts are still tried and it seems that they work just fine.

Quote:
And, even stranger, why is the connection not refused later in the session?
That's indeed strange. The only differences I see are the difference between the
root user's environment and the sudo environment.

Could you try it out using
"su - "
and then doing the failed mount, instead of using the "sudo"?
It would surprise me that the sudo had anything to do with it, but I'd like to be sure.
 
Old 02-09-2006, 10:01 AM   #10
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Quote:
Could you try it out using
"su - "
and then doing the failed mount, instead of using the "sudo"?
It would surprise me that the sudo had anything to do with it, but I'd like to be sure.
Code:
$ su -
Password:
# mount /mnt/tss-1/r
# ls /mnt/tss-1/r
Aug-Nov 2005
# exit
 
Old 03-23-2006, 12:43 PM   #11
PTrenholme
Senior Member
 
Registered: Dec 2004
Location: Olympia, WA, USA
Distribution: Fedora, (K)Ubuntu
Posts: 4,187

Original Poster
Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
Thumbs up Solved -- Sort of: The problem does not happen in FC5

After the smbfs references are all changed to cifs since smbfs is no longer supported in FC5.
 
Old 03-24-2006, 01:59 AM   #12
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
CIFS protocol is the successor of SMB. Windows should support both (in theory).
CIFS will be faster though.

Glad things are solved now.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Dual boot slackware, minor problem SnowSurfAir Linux - Software 13 06-23-2005 10:52 PM
Samba in fstab, problem hraposo Debian 9 12-16-2004 06:36 AM
Fstab problem with Samba jalperin Linux - Newbie 6 08-28-2004 03:25 PM
XP home fails to connect to samba shares J_Szucs Linux - Software 1 05-16-2003 10:21 PM
ready to weep: new server, install works, boot fails calebsg Linux - Software 2 11-19-2001 07:35 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration