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

I've made some changes in the .ini files and wanted to restart php5-fpm.

/etc/init.d/php5-fpm restart

Jan 20 14:25:48.171577 [ERROR] bind() for address '/var/lib/php5-fpm/apps.sock' failed: Address already in use (98)

How can I find out what is using this address? I've already stopped nginx but that didn't change anything.

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can use lsof

lsof /var/lib/php5-fpm/apps.sock

The output is lines containing the information

COMMAND, PID, USER, FD, TYPE, DEVICE, SIZE/OFF, NODE, NAME e.g.

lsof /lib64/libnss_files-2.12.so
COMMAND  PID USER  FD   TYPE DEVICE SIZE/OFF   NODE NAME
bash    2240 iain mem    REG  253,0    65928 142129 /lib64/libnss_files-2.12.so
bash    4700 iain mem    REG  253,0    65928 142129 /lib64/libnss_files-2.12.so
share|improve this answer
    
good idea, but I received a blank linke for /var/lib/php5-fpm/apps.sock, so it's actually not in use...but by restarting fpm it breaks with the same error :/ –  32bitfloat Jan 20 '13 at 13:56
    
@32bitfloat: You are running the restart as root/through sudo aren't you ? –  Iain Jan 20 '13 at 14:00
    
ah damn it, I forgot that. Thanks. I received three times php5-fpm with different IDs, seems I've got to kill some –  32bitfloat Jan 20 '13 at 14:04
    
yep, it worked, I could restart fpm. Many Thanks! –  32bitfloat Jan 20 '13 at 14:08
    
to your edit: I was not trying to restart fpm without root privileges (did you edit your previous comment? I read about not running netstat or lsof as root, on which I replied) It was (and is) a problem with php-fpm which runs as different processes, and it seems they are all accessing this file, so it could not restart. –  32bitfloat Jan 20 '13 at 14:43

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.