Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So I've got a Samba share located on server A. I have that share mounted to two other servers, B and C. The idea is that B and C need to write temporary files to a single location so that multiple background processing jobs (also running on B and C) have access to the same pool of files.

When the background processes are complete they delete the file they were working on. When I do a directory listing of the share after a file has been deleted the original files names are now along the lines of cifs79, cifs78 etc. They take up the same amount of space as the original file so I assume they are the originals, just renamed.

The problem is these files don't go away unless I restart samba (which I don't plan on ever doing). Am I missing a simple config param that will delete files immediately?

I created my shares with this command:

mount -t cifs // ./uploads -o username=samba_user,noexec

The files go into the share as -rw------- and remain that way after they change names.

Now, if I manually create a file from the box that has the share mounted, I can create, edit, delete no problem. If I start an IRB (interactive ruby) session, I can use Ruby to create/delete files no problem. It seems to be the app itself (Rails 2.3.3) which creates the file with strange permissions. But, the app and my IRB session are running as the same user, so they should have the same permissions to do whatever, no?

When I create a file on the command line or from IRB the permissions are set -rw-rw-rw-

Here's the full smb.conf file and the output of smbstatus at the bottom:

Thanks for any help!

share|improve this question

There is, probably, a sharing/locking problem on your files. The background process is temparing the files while they are still written to by whoever is creating them.

remove the:

locking = no

from your smb.conf file. It should solve the problem. This parameter should be used only on read only shares. Like cd. Make sure that all acess to those files is through samba share. If you access them directly from the os or from nfs share. Then read this carefully.

share|improve this answer
Hi, I removed that command but it didn't appear to make any difference (files were still being replaced with the cifs name). I logged into that box today (it's been about 20 hours since I made the change) and those temp renamed files are gone. <shrug> Maybe there's some background process that goes in and cleans them up? – Anonymous Aug 25 '09 at 16:16

I also encountered the same problem, and searched for a while. After I restart my computer, the files will go away.

share|improve this answer
On ServerFault simply rebooting is typically not considered a "real solution". Although it might mitigate the symptoms but you don't resolve the actual underlying problem. – HBruijn Jul 20 '15 at 19:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.