Linux Kernel: process namespace黑科技

通过这个namespace的概念,Linux上就可以实现一个虚拟的系统了。

什么意思?使用clone()系统调用,加上一定的flag,就可以将一个进程 process_a 放在与当前namespace  ns_a 不同的另一个namespace  ns_b 中,这时, process_a 在 ns_b 中的PID就是 1 ,也就相当于传统*NIX类系统的init进程。

当然,这个 process_a 在 ns_a 中还是可见的。只是,在 ns_a 中的进程号和在 ns_b 中的进程号不一样而已。

【1】:Namespace in Operation,Part I

【2】:Namespace in Operation,Part II

【3】:Namespace in Operation,Part III

【4】:Namespace in Operation,Part IV

【5】:Namespace in Operation,Part V

Extra:

【6】:Introduction to Linux Container,RedHat Linux

【7】:Namespace(7), Linux man pages

【8】:User Namespace Progress, Michael Kerrisk

【9】:The failure of Operating System and How we can fix it, Michael Kerrisk

【10】:http://stackoverflow.com/questions/26779416/what-is-the-relation-between-task-struct-and-pid-namespace

 未完待续。。。

:)

原文地址:https://www.cnblogs.com/walkerlala/p/5452366.html