Process assignment when executing `named`
Hi there,
Recently, I'm working on fuzzing BIND 9, and I need to check whether the BIND 9 is crashed by monitoring the processes related to named
. I noticed that BIND 9 creates multiple processes, even when I restrict the number of CPUs to 1 with -n
flag.
In detail, I compiled BIND 9.18.0 in a Ubuntu 20.04 docker container. Then, I executed ./bin/named/named -4 -f -g -d 5 -n 1 -c /etc/bind/named.conf
. The configuration is just recursive resolution as shown below:
options {
directory "/var/cache/bind";
dnssec-validation no;
recursion yes;
listen-on-v6 { any; };
};
Then, I checked the processes in htop
, and I found there were always 3-4 processes related to named
. The screenshot below is an example:
As you can see, named
is executed in 4 processes, whose PIDs are 132, 146, 147 and 148, even with -n
flag set to 1.
Therefore, I have the following questions:
- Q1: Is there any way to control the number of processes created by
named
? - Q2: If the answer of Q1 is no, since child processes always have smaller and consecutive PIDs than the parent one, does it mean that processes 146-148 are child processes of the process 132?
- Q3: If Q2 is the case, when
named
is crashed in accident, will all the processes be terminated? In another word, if I'd like to monitor whethernamed
is crashed, could I just monitor whether the parent process (whose PID is 132) is executing normally?
Many thanks for your time, and hope you have a nice day!
Best,
Qifan Zhang