Created
December 27, 2017 01:54
-
-
Save sursir/ae4aae2c3a0be6a9bc79b42866619bc4 to your computer and use it in GitHub Desktop.
php-strace
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| additional_strace_args="$1" | |
| MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep 'master process' | cut -d ' ' -f 6) | |
| while read -r pid; | |
| do | |
| if [[ $pid != $MASTER_PID ]]; then | |
| nohup strace -r -p "$pid" $additional_strace_args >"$pid.trc" 2>&1 & | |
| fi | |
| done < <(pgrep php-fpm) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment