Linux parent process and child process when 'sudo'

Posted 每天更强一点...

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Linux parent process and child process when 'sudo'相关的知识,希望对你有一定的参考价值。

如果在一般用户下如user,执行sudo命令,会产生两个进程。

ps -ef | grep Container

root 4305 643 0 16:37 pts/39 00:00:00 sudo ./ContainerCompilation.sh
root 4306 4305 0 16:37 pts/39 00:00:00 /bin/bash ./ContainerCompilation.sh

4306进程的父进程是4305,也就是说unix先生成4305进程将命令交给root,然后产生4306子进程来执行

以上是关于Linux parent process and child process when 'sudo'的主要内容,如果未能解决你的问题,请参考以下文章

Can't finish GitHub sharing process Successfully created project 'springcloud-parent' o

Parent and son

Android Processes and Threads

Program, Process and Thread

how kernel distinguishes between thread and process

Greenlets, threads, and processes