A
A
AlexWinner2015-11-10 19:47:09
PHP
AlexWinner, 2015-11-10 19:47:09

PHP-FPM: why unix socket is present in netstat but not on filesystem?

Good afternoon.
This happened:
In the config of the php-fpm pool, it is configured to listen to the socket:

listen=/tmp/www.socket
listen.owner=nginx
listen.group=nginx
listen.mode=0660

PHP restarts, no errors are thrown, but the socket does not appear:
# ls -la /tmp/www.socket
ls: cannot access /tmp/www.socket: No such file or directory

At the same time, I see it in the netstat output:
Active UNIX domain sockets (only servers)
Proto RefCnt Flags Type State I-Node PID/Program name Path
unix 2 [ ACC ] STREAM LISTENING 172275182 16589/php-fpm: mast /tmp/www.socket

Tried to search like this, can't find anything:
# sudo debugfs -R 'ncheck 172275182' /dev/sda2 2>/dev/null
Inode Pathname

Centos 7, PHP 5.6.
Tell me, please, where to dig?
UPD
The answer was found in the config /usr/lib/systemd/system/php-fpm.service , namely in the option:
PrivateTmp=true

Systemd creates a separate /tmp for the service.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
nirvimel, 2015-11-10
@nirvimel

Maybe php-fpm is chrooted.

Y
yalex1442, 2015-11-10
@yalex1442

is the file visible from root?
The problem is probably with permissions

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question