现在,向父进程发送一个SIGTERM。
父进程或子进程的终止。
当这个新进程(子进程)正在执行时,父进程仍然在运行。
When this new process-the child process-is executing, the parent process will still be running.
但是,在父进程退出之前,它必须释放共享内存。
Before the parent can exit, however, it must free the Shared memory.
代码实现通过共享内存段通信的父进程和子进程。
The code implements a parent and child process that communicates via a shared memory segment.
下面的例子将在父进程接收到信号时终止子进程。
The following example kills the children when the parent is sent one of the signals.
在此例中,父进程调用fork,等待两秒钟,然后退出。
In this example, the parent process calls fork, waits for two seconds, then exits.
问题只是哪个进程首先终止:父进程还是子进程。
It's just a question of who dies first: the parent or the child.
当父进程在60秒以后终止时,两个进程都消失了。
When the parent dies 60 seconds later, both processes are gone.
重要的是父进程必须以某种方式确认子进程的终止。
What is important is that the parent must somehow acknowledge the death of the child.
这意味着可消除僵死进程的唯一方法是终止父进程。
This means that the only way you can get rid of zombie processes is by killing the parent.
可以看到,PPID在父进程终止后更改为1。
您将使用返回值来确定哪个是父进程,哪个是子进程。
You use the return value to determine which process is which.
获得0的进程称为子进程,非零结果属于原始进程,即父进程。
The process that gets the 0 is called the child process, and the non-zero result goes to the original process, which is the parent process.
清单7.bash环境中的父进程和子进程示例。
Listing 7. Example of a parent and child process in a bash environment.
清单7与清单6相反——即在父进程之前终止的子进程。
Listing 7 shows the opposite of Listing 6 — that is, the child dying before the parent.
当shell脚本进程退出或返回到父进程时,退出码应该是0。
When a shell script process exits or returns to the parent process, the exit code should be 0.
该进程是AIX上运行的所有其他进程的父进程或根进程。
This process is the parent, or root, process to all other processes running on AIX.
进程还有父进程,在大多数情况下就是启动它的进程的PID。
A process also has a parent, which in most cases is the PID of the process that launched it.
如果父进程在子进程之前终止,孤立的子进程需要知道它们的父进程是谁。
If the parent process dies before its children, the orphaned children need to know who is their parent process.
但是,管道只能在父进程和子进程之间使用,不能在任意两个进程之间使用。
A pipe, though, can only be used between a parent and child process, not between two arbitrary processes.
尽管父进程可以访问其子进程的进程ID并向它传递参数,但是反过来不行。
Although a parent process can access the process ID of its child process and can thus pass arguments to it, the reverse is false.
由于子进程在后台运行,父进程一终止,控制即返回到Shell。
Because the child process is running in the background, control returns to the shell as soon as the parent dies.
子进程从终止时起就一直处于僵死状态,直到父进程确认该信号为止。
From the time the child dies until the time the parent acknowledges the signal, the child sits in a zombie state.
db 2Watchdog (db2wdog):所有其他进程的父进程。
Db2 Watchdog (db2wdog) : Parent process for all other processes.
默认情况下,exec继承父进程的组和用户ID,这就使得它会依赖于父进程。
By default, the exec function inherits the group and user IDs from the parent process, which makes it dependent on the parent process. This can be changed by.
init进程是Linux的第一个进程,它是所有其他进程的父进程。
The init process is Linux's first process, parent to all the other processes.
bInheritHandles确定了子进程是否要继承父进程的句柄。
BInheritHandles determines whether the handles have to be inherited to the child from the parent.
Init是将要在您的Linux操作系统上运行的所有其它进程的父进程。
Init is the parent of all other processes that will run on your Linux OS.
fork会创建一个子进程,与父进程相比只是PID和PPID不同;实际上,资源利用设为0。
Fork creates a child process that differs from the parent process only in its PID and PPID; in fact, the resource utilizations are set to 0.
应用推荐