Skip to content

Instantly share code, notes, and snippets.

@aalmodovar
Created February 16, 2017 14:46
Show Gist options
  • Save aalmodovar/059af9b2f9db75c4e5f3060d19c7ad55 to your computer and use it in GitHub Desktop.
Save aalmodovar/059af9b2f9db75c4e5f3060d19c7ad55 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Replace grep domain
additional_strace_args="$1"
MASTER_PID=$(ps auwx | grep php-fpm | grep -v grep | grep domain | grep 'master process' | awk '{print $2}')
while read -r pid;
do
if [[ $pid != $MASTER_PID ]]; then
nohup strace -r -p "$pid" -s 2000 $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