I have a GitHub repo to fix it for Ubuntu - https://github.com/AbhishekGhosh/Nginx-PHP5-FPM-Restart-Fix-on-Ubuntu.
Some work needed on /etc/init.d/php5-fpm
&& /etc/php5/fpm/php-fpm.conf
. All is written there. It is for Ubuntu 13, 14 etc. You possibly need a bit modification.