First, the phenomenon
1. See if a process exists
Ps-ef | Grep-v ' grep ' |grep-e ' Shell/cron/bonus/cash '
www 2624 1 0 Oct24? 00:00:35/usr/local/bin/php/data1/www/htdocs/hb.e.weibo.com/v2/www/htdocs/index.php--uri=shell/cron/bonus/cash- -get=proc_num=1&proc_total=1--post=
2. View process creation time
Ps-p 2624-o Lstart
Started
Sat OCT 24 22:20:03 2015
3. View system calls to the process
Strace-p 2624
Process 2624 Attached-interrupt to quit
Restart_syscall (... resuming interrupted call ...>) = 0
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 0) = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 1000 = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 0) = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 1000 = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 0) = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 1000 = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 0) = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 1000 = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 0) = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 1000 = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 0) = 0 (Timeout)
Poll ([{fd=5, events=pollin| pollpri| pollrdnorm| Pollrdband}], 1, 1000 = 0 (Timeout)
4. View fd=5 open files
Lsof-d 5 | grep 2624
PHP 2624 www 5u IPv4 3876970637 0t0 TCP 10.74.14.199:45473->host-31.alipay.com:https (established)
Second, reproduce
1. Listening for 107.170.249.52 1234 ports
NC-L 1234
2. Visit 107.170.249.52:1234
Curl http://107.170.249.52:1234
3.107.170.249.52 received the request
4.strace The Curl Process
5. Consistent with the phenomenon described above
Third, solve
Law 1:
Set timeout when Php curl call
Law 2:
Wen/k1ic (author of Jane book)
Original link: http://www.jianshu.com/p/8a247cae629a
Copyright belongs to the author, reproduced please contact the author to obtain authorization, and labeled "Jane book author."