php5-fpm.log filling up

185 views
Skip to first unread message

Adrian White

unread,
Oct 15, 2017, 6:44:24 AM10/15/17
to measureit
Hi
I noticed this evening my pi has run out of space and it seems to be the php5-fpm.log filling up with errors - 

[15-Oct-2017 21:37:03] ERROR: An another FPM instance seems to already listen on /tmp/php5-fpm.sock
[15-Oct-2017 21:37:03] ERROR: FPM initialization failed

Googling this hasn't revealed any useful info.
I have rebooted without resolution.

Any ideas?


Thanks in anticipation

Adrian 

Thomas

unread,
Oct 15, 2017, 7:12:13 AM10/15/17
to measureit
This error message means that there is already a running instance of the php server and another instance is trying to start.

PHP server is controlled by supervise (svc). It can happen that the server is crashed and blocks the local socket. So svc is trying to start a new server which it cant because of the blocked socket.

To delete the log you can do
echo '' > /tmp/php5-fpm.log

Is there enough space after deleting the log?
df -h

Then shutdown the php server
svc -d /service/php5-fpm

Then kill all running php processes.
killall -9 php5-fpm

Start the php server manual to see if there is any error
/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/php-fpm.conf

If not ctrl+c to stop php-fpm and then start the server with
svc -u /service/php-fpm

Adrian White

unread,
Oct 15, 2017, 7:43:20 AM10/15/17
to measureit
Many thanks Thomas. 
Followed your steps, started the php server manually without errors and it is working fine now. ~2GB free space.

Cheers

Adrian

Adrian White

unread,
Apr 22, 2018, 11:02:30 PM4/22/18
to measureit
Hi Thomas
Sorry but the problem has resurfaced, the php5-fpm.log is filling with the same errors, I have followed the steps several times without a satisfactory solution. The log fills immediately after restarting the server.

Any ideas for me please?

[23-Apr-2018 13:01:30] ERROR: An another FPM instance seems to already listen on /tmp/php5-fpm.sock
[23-Apr-2018 13:01:30] ERROR: FPM initialization failed




Cheers

Adrian 

Adrian White

unread,
Apr 24, 2018, 5:21:19 AM4/24/18
to measureit
Ok I've done a bit more digging, when I start the php server manually with using your instructions above Thomas and 

/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/php-fpm.conf

 I get no errors in the log and measurite works. But when I stop the server with 

killall -9 php5-fpm

and restart it with 

svc -u /service/php-fpm

I get the errors in php5-fpm log and also this in terminal

svc: warning: unable to chdir to /service/php-fpm: file does not exist

Any ideas?

Cheers

Adrian

Thomas

unread,
Apr 24, 2018, 1:19:04 PM4/24/18
to measureit
Hi Adrian,

you do not need to stop the server.

killall -9 php-fpm does what the order suggest. It kills all running php-fpm processes.

Supervise (svc) watch these processes. If they are not running it will start them again.

The killlall thing is only needed when supervice starts new processes when the old are in zombie mode. Which means that they are running and blocking but does not work any longer. So supervise tries to start them again.

To stop and start a service you can use: 
svc -d /service/(name_of_service) -d means down
svc -u /service/(name_of_service) -u means up

The list of the running services you can get with 
ls -la /service

A simple killall -9 should resolve your problem

The name of the php service is /service/php5-fpm
The name of the running instances is php-fpm 

;)
Message has been deleted

Adrian White

unread,
Apr 25, 2018, 2:34:42 AM4/25/18
to measureit
Hi Thomas
On a reboot I get the errors in php5-fpm.log. This is with supervise starting the service I presume.
When I -

ls-la /service

in terminal it returns this;

lrwxrwxrwx 1 root root 12 Oct 16  2016 /service -> /etc/service

then 

killall -9 php-fpm

obviously stops the php service but then measurite won't run and daemontools / supervise doesn't restart it automatically - I presume it should restart it. Could that be the cause of the error I get in terminal when I use:

root@raspberrypi:/home/pi#  svc -u /service/php-fpm                             svc: warning: unable to chdir to /service/php-fpm: file does not exist
?


If I start it with the command as I stated in the post earlier using this 

/usr/sbin/php5-fpm --fpm-config /etc/php5/fpm/php-fpm.conf

it then runs without errors and measurite works as it should. That is fine for now, but if my Pi restarts at any stage due to power outage or scheduled reboot then I get the log filling with errors.


What am I missing?



Adrian

Adrian White

unread,
Apr 7, 2020, 4:02:18 AM4/7/20
to measureit
In the unlikely event there are any others encountering this issue, I finally resolved it by upgrading to the latest ISO image provided by Thomas - 2018-06-27-raspbian-strech-light-measureit-121-2gb.img

Thanks

Warren

unread,
Dec 19, 2020, 2:02:47 AM12/19/20
to measureit

Hi
I have been suffering the same issue for some time now and even with the late rest issue things grind to a halt. The only get. Y I have is wiping the sd card, re partition it and set it all up again. Probably complete overkill but as I have no Linux knowledge what so ever, it is my only work around. Runs for about 6-9 months and I have to do the same again. 

Thomas

unread,
Dec 19, 2020, 9:06:09 AM12/19/20
to measureit
Which error message do you get?
Reply all
Reply to author
Forward
0 new messages