I have a web application which I am migrating from Ubuntu Lucid to Trusty. The app communicates w/ Nginx via unix domain sockets (created w/ a umask of 000
). On Lucid, I've had no problem with this setup. However, on Trusty, using the same permissions setup, Nginx gives me the following error:
*51 connect() to unix:/opt/run/skyhook/skyhook.socket failed (13: Permission denied) while connecting to upstream, client
Examining the permissions on both servers, I see this:
On lucid:
$ sudo ls -lh /opt/run/skyhook/skyhook.socket
srwxrwxrwx 1 skyhook skyhook 0 2014-08-21 17:09 /opt/run/skyhook/skyhook.socket
$ sudo sudo -u www-data ls -lh /opt/run/skyhook/skyhook.socket
srwxrwxrwx 1 skyhook skyhook 0 2014-08-21 17:09 /opt/run/skyhook/skyhook.socket
On trusty:
$ sudo ls -lh /opt/run/skyhook/skyhook.socket
srwxrwxrwx 1 skyhook skyhook 0 Nov 4 15:36 /opt/run/skyhook/skyhook.socket
$ sudo sudo -u www-data ls -lh /opt/run/skyhook/skyhook.socket
ls: cannot access /opt/run/skyhook/skyhook.socket: Permission denied
Same permissions on both servers, different results. Nginx runs as www-data on Ubuntu. With the 777
permissions, I would expect www-data to be able to interact with the socket, but it can't. What is going on?
UPDATE:
The permissions of /opt/run/skyhook
are the same on both lucid and trusty:
$ sudo ls -lhd /opt/run/skyhook
drwxrwx--- 2 skyhook skyhook 4.0K Nov 4 15:36 /opt/run/skyhook
For /opt/run
the differences are minor. On lucid:
$ sudo ls -lhd /opt/run/
drwxrwxr-x 4 www-data www-data 4.0K 2014-01-27 18:11 /opt/run/
On trusty:
$ sudo ls -lhd /opt/run/
drwxr-xr-x 4 root root 4.0K Nov 4 09:33 /opt/run/
For /opt
both are the same:
$ sudo ls -lhd /opt/
drwxr-xr-x 7 root root 4.0K 2013-06-07 17:15 /opt/
However, I don't see how any ancestors beyond the parent directory would affect this?