如何识别BIND在chroot下运行

我试图在Ubuntu和CentOS的chroot下运行BIND。 在CentOS上安装它非常简单,只需安装软件包 – bind和bind-chroot,而Ubuntu有一点涉及。

我一直在下面的链接,让它在Ubuntu上运行,

https://help.ubuntu.com/community/BIND9ServerHowto

http://www.tokiwinter.com/installing-chrooted-bind-ubuntu-12-04-server/

我可以启动并运行,但我无法弄清楚BIND是否在chroot中运行。

从我可以看到它没有在chroot中运行,因为chroot目录中没有pid文件,而是在/ var / run / named目录中仍然有一个pid文件。

还试图看到使用下面的过程目录映射的位置

[root@centos-test etc]# ls -ld /proc/2839/root lrwxrwxrwx. 1 named named 0 Feb 11 04:01 /proc/2839/root -> / [root@centos-test etc]# 

但是根据我在不同的地方阅读的内容,上面的命令应该指向chroot的目录,如果它运行在监狱里的话。

我如何准确地确定我是在一个chroot监狱里面呢?

很简单:如果named使用-t <directory>标志运行,那么就是chroot。 否则 – 不是。