There is an issue I couldn't find the exact problem, or is it a problem anyway I don't know.

I execute below command through shell_exec in php. I'm user I called just once.

curl -o ./server.log --request POST 'crawlserver.xxx.local/workerCallback.php' --user-agent 'xxx' --data 'workerid=worker1&jobid=25&offercount=72&file='/path/to/xxx-2014-02-07-serialized.txt'

this command working like 30 seconds.

while when I ask to bash as ps aux | grep workerCallback

I see 2 different commands triggered, and different process ids. But when look to server.log file it is looking a single request, also I check db and other stuff, the request worked single. But why it is looking twice in commandline by different pids, and commands has little differences. What is the "sh -c" before the command.

1000 27384 0.0 0.0 4404 612 ? S 14:00 0:00 sh -c curl -o ./server.log --request POST 'crawlserver.xxx.local/workerCallback.php' --user-agent 'xxx' --data 'workerid=worker1&jobid=25&offercount=72&file=path/to/xxx-2014-02-07-serialized.txt'

1000 27385 0.0 0.0 88056 3756 ? S 14:00 0:00 curl -o ./server.log --request POST crawlserver.xxx.local/workerCallback.php --user-agent xxx --data workerid=worker1&jobid=25&offercount=72&file=/path/to/xxx-2014-02-07-serialized.txt

有帮助吗?

解决方案

Its not the same command twice, the first command is the shell (sh) running your curl command.

The second one is the command itself.

So your code is working fine :)

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top