Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I recently upgraded my Debian server from buster (version 10) to bullseye (version 11) and noticed that bind9's systemd name changed from bind9 to named. Also, the named service now runs in the foreground because '-f' switch is specified in the named.service file provided by the distribution. The previous version used forking as the startup type and ran as a daemon.
What is the implication of running this service in the foreground instead of running as a daemon? I thought named is supposed to be run as a daemon. Is this a standard practice now?
I recently upgraded my Debian server from buster (version 10) to bullseye (version 11) and noticed that bind9's systemd name changed from bind9 to named. Also, the named service now runs in the foreground because '-f' switch is specified in the named.service file provided by the distribution. The previous version used forking as the startup type and ran as a daemon.
What is the implication of running this service in the foreground instead of running as a daemon? I thought named is supposed to be run as a daemon. Is this a standard practice now?
Thank you.
Hi,
The named service is supposed to run in the background as all the daemons do.
Perhaps in your case someone has changed that (i.e. adding the -f option) in order to debug something and forgot to remove it later.
Thank you for your replies.
I thought that it should be running in the background as well.
Actually, the '-f' option was placed by Debian distribution people.
It is indicated in their documentation (https://wiki.debian.org/Bind9#Debian_Jessie_and_later).
Also, below is the excerpt of the actual contents of the file /lib/systemd/system/named.service, which is what the bind9 package installed and I have never modified.
I think I can override the option so it runs in the background, but I was wondering why this change was made. Maybe there is a good reason for running it in the foreground..?
I'm not familiar with debian, but from the link you've posted:
Quote:
However, at least as of Debian 10 buster, it's probably better to remove such a /etc/systemd/system/bind9.service.d/bind9.conf file (as the manner in which systemd now starts bind9's named, has changed, and will typically conflict with override done as the above), and now is best to have the overrides in /etc/default/bind9, e.g.:
OPTIONS="-u bind -t /var/bind9/chroot"
and systemd will now incorporate the OPTIONS from /etc/default/bind9 and use those (as will at least also sysvinit).
So, looks like they removed the -f option.
Besides there is no reason to run a daemon in foreground except for debug reasons.
The '-f' option is still present in their configuration.
They did not put in the OPTIONS variable, but it is included in the ExecStart command in the /lib/systemd/system/named.service file as shown below.
Code:
ExecStart=/usr/sbin/named -f $OPTIONS
I do not know why this change was made, but I will follow your advice and run it in the background.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.