为什么shell_exec创建了多个进程?

I have this code:

Shell_exec( 'sudo python /etc/MACT/temp_alarm.py ' . $channel1 . ' temp' .  "> /dev/null 2>/dev/null &" );

It is triggered via the isset from php. When I look at the process on the RPi, I can see two processes running. Any thoughts on why?

Thank you.

There might be a whole series of programs executed in response to that PHP command:

  • A copy of /bin/sh to interpret the command line.
  • A copy of sudo invoked by the above /bin/sh
  • A copy of /bin/sh to interpret the sudo command line
  • A copy of python invoked by the above /bin/sh
  • Any programs invoked by temp_alarm.py during its execution.