Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I'm using nginx 1.3.8 inside a centos 6.3 virtualbox 4.2.4 virtual machine. The system is running the latest software available via yum update. The host OS is windows 7. The site files nginx is serving are on mounted samba partition, which is a folder on the host Windows system.

I.e., inside linux, nginx paths are referring to /home/vhosts and this is mounted from D:\vhosts\ on windows. The samba partition is mounted as root with 777 privileges. /etc/fstab looks like this, but with real ip, username, password:

//hostip/vhosts   /home/vhosts   cifs   username=username,password=SECRETPASSWORD,uid=root,gid=root,file_mode=0777,dir_mode=0777,rw,_netdev   0 0

I.e. linux/nginx reads from the windows share, and not the opposite.

in /etc/samba/smb.conf, I have tried to disable all samba locking features, but it seems to have no effect even after rebooting the virtual machine.

locking=no
share modes=no
oplocks = no
level2 oplocks = no
kernel oplocks =no

I'm receiving "Access is denied" errors in Windows or linux when attempting to overwrite the javascript file in windows that has been accessed at least once with nginx.

If I run "service nginx reload", the lock is removed and I'm able to save the file. That's why I think it is nginx causing the lock.

The same problem occurs with directories. However, that may be a different issue not related to the use of samba.

I'm using samba so that I can manage the source code outside of the virtual machine.

Also note that after I run "service nginx reload", the file I'm editing is actually automatically deleted from the windows host.

SOLVED: I just reviewed my nginx.conf file. It appears the "open_file_cache" feature is what is causing the lock and deleted files. When I set this option to open_file_cache off;, My problem is resolved. I will repost as the answer when it allows me to do so.

share|improve this question
    
If you solved it, the preferred approach around here is to answer your own question and accept it (when you can, after a 48hr delay). More useful for any future visitors to your question that way. –  HopelessN00b Nov 22 '12 at 0:04

1 Answer 1

up vote 0 down vote accepted

SOLVED: I just reviewed my nginx.conf file. It appears the "open_file_cache" feature is what is causing the lock and deleted files. When I set this option to open_file_cache off;, My problem is resolved.

The developers of nginx also closed my bug report saying that I shouldn't use open_file_cache if I want to edit the files in Windows. They don't see this as a bug.

share|improve this answer

Your Answer

 
discard

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.