-1
root@test:/var/lib/tomcat/webapps/logs# ps aux | grep ppm
root     25522  0.0  0.0   1844   500 ?        SN   14:13   0:00 sh -c /bin/bash -c "pdftoppm -f 1 -l 1 /pdf/input.pdf test/processing/output"
 root     25523 49.6  0.7  18192 12620 ?        RN   14:13   0:59 pdftoppm -f 1 -l 1 /pdf/input.pdf /test/processing/output
root     25539  0.0  0.0   2016   636 ?        R+   14:15   0:00 grep ppm

我不熟悉这个命令。为什么两个进程正在运行我不明白。

4

2 回答 2

1

These are not two pdftoppm processes. The following is the pdftoppm process:

root     25523 49.6  0.7  18192 12620 ?        RN   14:13   0:59 pdftoppm -f 1 -l 1 /pdf/input.pdf /test/processing/output

The following is the process for the shell command:

root     25522  0.0  0.0   1844   500 ?        SN   14:13   0:00 sh -c /bin/bash -c "pdftoppm -f 1 -l 1 /pdf/input.pdf test/processing/output"

The first line in your grep output is for the shell command that was executed. The second line was for the actual pdftoppm invocation. The third line was for the grep. (Both your shell command and grep contained the string pdftoppm, which were a part of the process list when queried.)

于 2013-07-29T07:13:21.453 回答
0

shell 脚本很可能是通过system调用来执行的(这就是它在 c 中的样子)。此系统调用调用命令处理器(在您的情况下为 PID 25522)来解释命令。

命令本身就是 PID 为 25523 的进程。

在 C 中,exec命令族在调用命令行解释器的情况下执行命令。

于 2013-07-29T08:13:58.253 回答