Ubuntu 5.10 and Samba, problems

richcom23

Limp Gawd
Joined
Feb 14, 2003
Messages
509
Basically the problem is with the documents share (see config below) but I don't know if it is related to samba or to the *nix file system. The "Homes" are working excellent with no problems. The "Documents" problem is this, when you edit a Word, or Excel document the PC freezes up. When you go back into the folder where you edited the file, it is named some wierd temporary file now instead of .doc or .xls. You can create a new file with NP, until you reopen it to edit it, then this problem happens. Microsoft Access databases are shared in this share as well, and those work with NP at all, even with multiple users accessing them at the same time.

To add to MY confusion, I had it all working yesterday, and I came in today and it is doing the same thing. Edit a file and the computer locks up, any computer, I've tried it on several in the office. It's almost like when you try to edit a file it "thinks" too much and goes nuts. I created a "samba" group and made all users part of that group. I then did a chmod and chown to make ownership of the files in this directory (and subdirectories, -R) belong to the samba group. I don't understand the create masks very well and have been looking for a good link to explain specifically what 0775 or 0700 or 0777 mean, but haven't been able to find a good one yet.

See any problems with my config? Any ideas? I'm not that good with Linux yet, but I've been trying to learn.

CONFIG:

[global]
workgroup = OFFICE
server string = %h server (Samba, Ubuntu)
obey pam restrictions = Yes
passdb backend = tdbsam, guest
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
syslog = 50
log file = /var/log/samba/log.%m
max log size = 50
directory mask = 0775
oplocks = No

[homes]
comment = Home Directories
read only = No
create mask = 0700
directory mask = 0700
browseable = No

[Documents]
path = /usr/NetworkShare
read only = No
create mask = 0775
guest ok = Yes
writeable = yes

Thanks.
 
richcom23 said:
See any problems with my config? Any ideas? I'm not that good with Linux yet, but I've been trying to learn.

CONFIG:


[Documents]
path = /usr/NetworkShare
read only = No
create mask = 0775
guest ok = Yes
writeable = yes

Thanks.

I'd change the "create mask" variable in your Documents stanza to match the home directories. "create mask = 0700"
Restart samba, try it again.

Also might want to add "log level = 3" to your Global stanza if that doesnt work to see _exactly_ what's happening when the files are accessed/written. Also do some checking on the file permissions of the /usr/NetworkShare dir to make sure that the samba group has write/read access.
 
OK. Tried it.

Samba group is the owner and it has read, write, execute permissions. I tried using the 0700 mask, doesn't make a difference. Whenever I edit an excel or word file again, it makes some wierd temporary file and locks up my computer (from being so busy or somthing).
 
Well after doing some more research it looks like 0775 is the mask I want to use, it gives read, write, execute permissions to the file owner, and the file owner's group, but not write permissions to others.

MORE INFO: I noticed if I am the creator (owner) of a file then I can edit it no problem. But if another user comes along to edit the file I own, there is where the problem lies. It seems I need to make sure if I own a file, someone else can edit it. What steps can I take so that if I create a file, and someone else comes along to edit it, it will let them, and change ownership of the file to them at that point. Then, if I come along and re-edit the file, the file will belong to me again. Isn't there something with a "sticky bit" I can do this with? I can't seem to find the answer on the web, or I am missing it somehow. EXPERT HELP please =)

This is a large shared folder on the network that all people in my "samba" group should be able to create, add, or edit files in.

Current Config:
[global]
workgroup = OFFICE
server string = %h server (Samba, Ubuntu)
obey pam restrictions = Yes
passdb backend = tdbsam, guest
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\sUNIX\spassword:* %n\n *Retype\snew\sUNIX\spassword:* %n\n .
log level = 3
syslog = 50
log file = /var/log/samba/log.%m
max log size = 50
oplocks = No

[homes]
comment = Home Directories
read only = No
create mask = 0700
directory mask = 0700
browseable = No

[printers]
comment = All Printers
path = /tmp
create mask = 0700
printable = Yes
browseable = No

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers

[Documents]
path = /usr/NetworkShare
read only = No
create mask = 0775
directory mask = 0775
guest ok = Yes
 
Give this a shot..

[Documents]
path = /usr/NetworkShare
public = yes
writable = yes
create mask = 0777
directory mask = 0777

I don't know but this is how mines setup and I haven't have a lockup issue yet.
 
Roach said:
Give this a shot..

[Documents]
path = /usr/NetworkShare
public = yes
writable = yes
create mask = 0777
directory mask = 0777

I don't know but this is how mines setup and I haven't have a lockup issue yet.

I will try adding the "public = yes" line to my config and see if that works. I don't really want to use the 0777 mask because that lets people outside of the group I assign write to that share. I need to be able to control who has read only access and who doesn't. On a side note, I used a 0777 mask just to check and see if it would work like that and it doesn't. Maybe the "public = yes" line is the answer though. Will repost once I test it.
 
I think Roach has the solution...

However, "log level = 3" in your global stanza shows you a TON of good info when troubleshooting samba (FWIW, or anything above 3.... I use if I'm really stuck).



;)
 
Thanks for the help.

I added the "public = yes" line to my config and it seems to have cleared up the issue with the computers not being able to edit. I was able to edit several files, and the ownership changed as I tried it out with different users, but the group stayed the same. I was able to edit, and re-edit, with a number of users with NP.

However, with that said, it saves kinda slow... not trying to be picky but it takes like 4 seconds to fully save the file before it quits. Before it used to save instantly. I just upgraded to Ubuntu 5.10 from Red Hat 8, maybe that is the difference. It definetly could use more than 512MB of RAM, but unfortunately the computer has RDRAM so I won't be upgrading it that's for sure. The network is all gigabit so I'm sure the network is plenty fast enough. Microsoft Access seems faster than ever though, odd.
 
Well the problem reoccurred again today... *pulls hair out*

But the solution was quite simple, I just had to do a "sudo chmod -R 2775 /usr/NetworkShare" and all was well. Apparently this makes the file permissions work right with the group ownership. (All the Linux people are saying, you idiot you didn't do that already?) No I'm a Linux noob, but it's things like this that let you learn. I still need to take a class or something to fill in some fundamental blanks I have...
 
Back
Top