Thursday, August 25, 2011

Handling the "open() 11 resource temporarily unavailable" error with nginx (samba problem)

If you happen to edit your files through samba and serve them with nginx you may get some "11: Resource temporarily unavailable" which are originated by the fact that nginx cannot open the file in question.

Samba performs a lock to the file you're editing and I don't know exactly how nginx open the files it's serving, but the problem is that Samba locks the file nginx is trying to read.

So, a bit of searching through the locking options with Samba and I found out an option to put in smb.conf that solves the problem:

oplocks = no

This option enables or disables support for oplocks on the client. The option is enabled by default so we're turning it off.

Restart Samba and you should not get more open() errors.

Carlos

3 comments:

Pooch said...

Worked perfectly, thanks for the tip!

Rennex said...

Thanks, instant solution to my problem!

keogh said...

You are a legend, this was confusing the hell outta me! Thanks

Followers

About me

Santa Fe, Argentina
Programador Web, PHP, MySQL, JQuery, Administrador Linux. LAMP, Lighttpd, Nginx.