{"id":3606,"date":"2015-10-09T23:55:14","date_gmt":"2015-10-09T22:55:14","guid":{"rendered":"https:\/\/blog.ed.gs\/?p=3606"},"modified":"2015-10-09T23:55:14","modified_gmt":"2015-10-09T22:55:14","slug":"strace-multiple-processes","status":"publish","type":"post","link":"https:\/\/ed.gs\/2015\/10\/09\/strace-multiple-processes\/","title":{"rendered":"Strace Multiple Processes"},"content":{"rendered":"
To get debugging information about a running process when your log files aren’t showing you enough information it can be useful to use the strace command. The problem is if you’re running a process with multiple children then you’ll need to add each of the process ids (PIDs) to be traced. First off, make sure it’s installed:<\/p>\n
apt-get install strace<\/pre>\nNow let’s look for an example process and strace all of the process children to get the current output:<\/p>\n
ps auxw | grep php-fpm | awk '{print"-p " $2}' | xargs strace 2>&1 | grep -v poll | grep -v clock_gettime<\/pre>\nAs you can see in the above command, we looked for php-fpm using ps, pulled the IDs of all the running children and straced the result. This will give you a live stream of what the processes are currently doing.<\/p>\n","protected":false},"excerpt":{"rendered":"
To get debugging information about a running process when your log files aren’t showing you enough information it can be useful to use the strace command. The problem is if you’re running a process with multiple children then you’ll need to add each of the process ids (PIDs) to be traced. First off, make sure […]<\/p>\n","protected":false},"author":2,"featured_media":3553,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false},"categories":[19,41],"tags":[],"yoast_head":"\n
Strace Multiple Processes - E<\/title>\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n\n\n\t\n\t\n\t\n