Click to See Complete Forum and Search --> : Weird Samba Problem


AtomicToad
12-03-2002, 10:51 AM
Hi everyone. I set up samba on my new linux server, and everything seemed to be working perfectly, but then it suddenly stopped. Suddenly all files on the samba server were showing up as read-only from the windows networked computers. I SSH'd in as root, then did "chmod -R 777 share" and then all the files in the share directory and all subdirectories were fine again. I just chalked it up to some unexplainable mystery that had been fixed, if not solved.

But then it happened again. So I SSH'd in as root and did the same thing. And that fixed it again -- for a day. Now it happens every 1-2 days and I really have no idea why. The server just seems to "wear out" or something like that -- it will share files fine for a few days, then suddenly everything will be read-only, and I have to go "chmod -R 777 share" again to fix it. I was thinking about setting up a script to automatically run that command every 12 hours, but I'm thinking that that's a bit absurd. Does anyone know what might be going wrong?

Here's the line from my smb.conf file that sets up the share:

[share]
comment = Shared Folder
path = /home/share
valid users = <list of all users>
public = no
writeable = yes
printable = no
create mask = 0777

I'm running mandrake 9, and I think I have all the recent updates to samba -- I did the "download most recent software upgrades" or however it was phrased when I installed mandrake, and it downloaded updates for a long while. Any ideas what might be going wrong?

RobSmul
12-03-2002, 02:30 PM
Hi,

Does it happen on all your shared files? or only one or two shares?

What are the permissions, before you chmod everything again?

Are you rebooting the Samba-machine often? or never?

Grtz. Rob

AtomicToad
12-03-2002, 03:34 PM
It happens on all the shared files. I don't know what the permissions look like when it happens -- I guess I'll have to wait until it happens again to find out. Right now all the permissions are set to -rwxrw-rw- for files and drwxrwxrwx for directories. I'll post again when it happens again and note what the permissions look like then.

AtomicToad
12-03-2002, 03:35 PM
Oh, and the samba machine is never being rebooted. The old file server was a WinME machine that had to be rebooted twice a day at least. Even with this permissions problem, the linux server is 10,000 times better!

RobSmul
12-03-2002, 03:53 PM
very very weird...

Is there any other program running which uses the same files and can be causing the problem?

Also, look in you log-file:
/var/log/samba/log.smbd

when you get an access denied, look in this log-file as well as the one of the computer you are trying to access the share:
/var/log/samba/log.COMPUTERNAME

Is this your PDC (primary domain controller), if not, do you use Winbind?

If this all turns out on nothing I really don't know how this is caused...

AtomicToad
12-03-2002, 04:49 PM
I don't think there are any other programs running that use the same files -- there certainly shouldn't be -- the folder is just a newly created folder in the /homes directory. The server is not my pdc, but winbind may have something to do with it. Winbind crashed on startup when I started the server last, but I never looked into it because samba runs fine anyway. Do you think that might have something to do with it? Maybe I should start troubleshooting winbind. But I can't imagine why it would function normally for a day or two and then suddenly give out read only errors. The next time it happens I'll check the log. It should be due to happen again tomorrow afternoon some time. =)Let's see!

AtomicToad
12-03-2002, 05:15 PM
Allright, great -- it just happened again -- ahead of schedule. I'm actually happy to see it happen again because now I can post here about it. =)

from /var/log/samba/log.smbd:


[2002/12/03 04:39:50, 0] lib/util_sock.c:write_socket(524)
write_socket: Error writing 5 bytes to socket 5: ERRNO = Connection reset by \
peer
[2002/12/03 04:39:50, 0] lib/util_sock.c:send_smb(704)
Error writing 5 bytes to client. -1. (Connection reset by peer)
[2002/12/03 07:46:00, 0] smbd/server.c:main(707)
smbd version 2.2.6 started.
Copyright Andrew Tridgell and the Samba Team 1992-2002
[2002/12/03 07:47:00, 0] smbd/server.c:open_sockets(238)
Got SIGHUP

But the error just occurred now, and "date" tells me that the server thinks it's 12:06PM (I'll have to fix that) -- so these errors are all pretty old, and those were the last ones in the file.

Permissions on the read only file are:

-rwxrw-rw- 1 benjamin benjamin 151040 Dec 3 11:59 Timesheet.xls*

Looks writeable to me! Same permissions as earlier, when there was no read only error. Oh... but the exact error from windows is that the FOLDER is marked as read only... let me check the permissions on that...

drwxr-xr-x 49 root root 4096 Dec 3 05:18 share/

Well. As you can see, there are Ws missing...
Why could they have possibly disappeared? I chmod this thing constantly -- I'll chmod it now, and I'll probably have to chmod it again tomorrow. Nobody else in this network has root access, so no one else could be changing it. It just randomly changes to read only at will, it seems.

Any guesses on where to go from here? Any logs or anything?
Thanks for all the help so far -- at least now I know that it's not specifically a samba issue, but the file permissions themselves are being reset. Weird!

RobSmul
12-04-2002, 06:13 AM
Don't laugh,

I think I have exactly the same problem :eek:

I installed Samba just recently, but every morining when I want to open the share again, I can't. It looks like a permissions problem, but it isn't.

The problem I have is because of Winbind, which I think is your problem as well.

In my /var/log/samba/log.winbind it says:
__________________________________________________ __

[2002/12/04 10:52:30, 0] lib/util_sock.c:read_socket_with_timeout(298)
read_socket_with_timeout: timeout read. read error = Connection reset by peer.
[2002/12/04 10:52:30, 0] rpc_client/cli_pipe.c:rpc_api_pipe(359)
cli_pipe: return critical error. Error was SUCCESS - 0
[2002/12/04 10:52:30, 0] lib/util_sock.c:write_socket_data(500)
write_socket_data: write failure. Error = Connection reset by peer
[2002/12/04 10:52:30, 0] lib/util_sock.c:write_socket(523)
write_socket: Error writing 202 bytes to socket 5: ERRNO = Connection reset by peer
[2002/12/04 10:52:30, 0] libsmb/clientgen.c:cli_send_smb(95)
Error writing 202 bytes to client. -1
[2002/12/04 10:52:30, 0] rpc_client/cli_pipe.c:rpc_api_pipe(359)
cli_pipe: return critical error. Error was NT_STATUS_OK
__________________________________________________ __

"write_socket_data: write failure. Error = Connection reset by peer"

Same as your error I think. When I restart Winbind everything works again.

I think it is because Winbind connects to the PDC and gets its users and groups. In my network this PDC is shut down at night, which troubles the connection with Winbind. Winbind doesn't reopen this connection in the morning, but I need to restart it.

But these are just my personal thoughs....

There is still a difference between our problems, that is, I have the errors in my log.winbind and you in your log.samba... Furthermore resetting the permissions doesn't work for me.

When your problem occurs again... Can you restart winbind and tell me if that helps. And do you know or your PDC gets restarted?

Let's work to a solution to this problem...

Grtz. Rob

AtomicToad
12-04-2002, 10:42 AM
My PDC definitely doesn't get restarted either, and I don't know if winbind is running. Is that a stupid thing to say? What's the name of the winbind daemon? When I do ps -A, I can see all the smbd's, but I don't see any winbindd or anything like that. I've got xined, cupsd, syslogd, nfsd, rpciod, lockd, unlinkd, rwhod, httpd-perl, httpd, proftpd, crond, squid, lisa, unlinkd, mingetty, nmbd, atd, saslauthd, sshd, and pickup running, but that's pretty much it.

RobSmul
12-04-2002, 12:57 PM
ps -ae | grep winbindd

This command should produce output like this, if the daemon is running

3025 ? 00:00:00 winbindd


you can also check by typing:

service winbindd status

AtomicToad
12-04-2002, 01:05 PM
"cannot find windbind service"

Apparently I'm not running winbind, after all.
I thought you needed it to run Samba, but apparently not!

RobSmul
12-04-2002, 01:10 PM
Yes you do need to run Samba...

Winbind is an extra utility for Samba to integrate the user and group information stored on the windows PDC into Samba.

You probably had to create users on the Samba-box with the same username and password as it has on your windows-pc.

This winbind is causing my problem, but it isn't in your case.

gnunew
12-05-2002, 09:58 PM
Not to say that this will help (I am very new to Linux) but I was having trouble getting permissions on boot. Everything was visible, but not w or X. I had tried chmod after booting, but no luck. I finally set up my mnts in automount (RH8) using the umask=000 parameter as follows:

win-c -fstype=vfat,rw,exec,umask=000 :/dev/hda1

I hope this helps!

RobSmul
12-06-2002, 08:50 AM
Originally posted by AtomicToad
"cannot find windbind service"


have you tried winbindd, with double d, like I said?

So:

service winbindd status

AtomicToad
12-06-2002, 10:54 AM
gnunew:

I think I do have a problem with the way my disks are mounted, actually. It turns out that this share directory that is causing me all these problems is in the /home directory. I don't think linux likes me chmodding /home to 777 -- it keeps resetting it. I've tried creating other folders in non system folders and linux doesn't change the permissions on them.

So, I thought it would be a good idea to just cp -R the entire share directory from /home/share to just /share. BUT, when I tried that, I quickly ran out of disk space. See, I made the horrible mistake of mounting 99% of my disk space to /home (this machine is just a file server, so I thought I'd give most of the disk space to where the files would be -- bad idea to use /home though).

Can someone tell me how to change the way my file system is mounted so that /share can use the disk space that /home is currently using? I tried doing "mount /share /dev/sdb6" (which is the scsi drive where all this is mounted), but that just created a mirror of /home/share in the /share folder -- basically /share is now a shortcut to /home/share, which means that when /home/share remods itself, so does /share. And when /home/share is remodded to 777, so is /share automatically.

I would love to just move all my files to /share and leave /home to do what it wants. Can anyone tell me how to do this? It would make me very, very happy!

RobSmul:

I did that the first time, but it didn't find the service. My "Cannot find the winbind service" was a typo -- I should have written "Cannot find the winbindd service." Sorry! =) But no, winbindd isn't running. Thanks again for your help!