Skip to main content

shell-tips

Reload PHP-FPM​

Bash Script​
#!/usr/bin/env bash

pid=ps aux | grep "master process" | grep -v 'grep' | awk '{ print $2 }'
kill -USR1 $pid
kill -USR2 $pid

One line​
export pid=$(ps aux | grep "master process" | grep -v 'grep' | awk '{ print $2 }') && echo "FOUND: $pid" && kill -USR1 $pid && kill -USR2 $pid
One line Get PID​
ps aux | grep "master process" | grep -v 'grep' | awk '{ print $2 }'