Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

On Debian Squeeze, when nginx is running, it puts a handle on my development files (css, html) and I am unable to delete them unless I stop nginx. This is a problem because it's my development environment (I wouldn't care if it was production), is there any setting I can switch so it doesn't put a lock on all my files?

share|improve this question
That doesn't sound like normal Linux behavior. Do you have some command output? – Jeff Ferland Dec 5 '12 at 23:53
When I try to delete it, it says "text file is busy". Here's the lsof output: COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME nginx 1534 www-data 12r REG 0,18 32401 8 style.css – Ayub Dec 5 '12 at 23:56
Exactly how are you trying to (1) delete the files, and (2) replace them? And what type of filesystem is storing these files? – Michael Hampton Dec 6 '12 at 0:00
Solved this by turning open_file_cache off Got the answer from here… – Ayub Dec 6 '12 at 0:07

Best guess is:

Your files aren't actually on a UNIX or Linux filesystem, but on a Windows-based filesystem, either mounted locally (NTFS) or remotely via SMB/CIFS. These filesystems don't permit one process to remove a file being used by another process.

On a normal UNIX or Linux filesystem, you could replace the file with no issues, and the process that had the file open would still use the old file until it closed it, at which point it would be permanently deleted.

The solution here is to move your files off the NTFS or CIFS share and onto a native filesystem.

share|improve this answer
Thanks for the guess, but the problem was that I had a setting in nginx that locks files, I turned that off on development environments, and it is working normally now. – Ayub Dec 6 '12 at 0:09
Well, it's not a bug, just the way Windows filesystems work. – Michael Hampton Dec 6 '12 at 0:12
@Ayub Indeed, mentioning that you were serving files from a network filesystem on another OS would have been very helpful. – Jeff Ferland Dec 6 '12 at 1:11

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.