pgte / fugue

Unicorn for node.js
MIT License
396 stars 14 forks source link

Can't give nginx rights to read unix socket #11

Closed jney closed 13 years ago

jney commented 13 years ago

Hello,

I'm trying to configure nginx and fugue, but nginx doesn't have permission to read socket

srwx------ 1 www  www     0 2011-04-12 21:10 fugue.sock
srwxrwxrwx 1 root root    0 2011-04-12 20:48 unicorn.sock

So i tried to launch it as nobody :

fugue.start(app, '/tmp/www/sockets/fugue.sock', 4, {uid: 65534, gid: 65534});

but the owner of the socket is still the launcher of the program, current user or root when launched with sudo

How can i change this ?

pgte commented 13 years ago

Delete the file and try setting umask on your app before calling fugue.start

jney commented 13 years ago

hi pedro,

i tried :

var oldUmask = process.umask(0000);
fugue.start(app, '/tmp/www/sockets/fugue.sock', 4, {started: function () {
  process.umask(oldUmask);
}});

And :

umask 000 && node app.js

And nothing changed. I cannot figure out why

pgte commented 13 years ago

Ok. I just confirmed, it's an issue on fugue. Will work on it ASAP. Thanks for the report.

jney commented 13 years ago

ok, thank you for answering so fast

pgte commented 13 years ago

Should be fixed on release v0.1.2.