LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 02-07-2023, 09:46 PM   #1
md303
LQ Newbie
 
Registered: Dec 2016
Posts: 9

Rep: Reputation: Disabled
bind9 running in foreground


Hello,

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.
 
Old 02-08-2023, 07:45 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by md303 View Post
Hello,

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.
 
Old 02-08-2023, 07:59 PM   #3
elgrandeperro
Member
 
Registered: Apr 2021
Posts: 415
Blog Entries: 2

Rep: Reputation: Disabled
I would check the defaults in /etc/default/(name of service). This sets the default options passed to bind/named.
 
Old 02-08-2023, 11:12 PM   #4
md303
LQ Newbie
 
Registered: Dec 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hello,

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.

Code:
[Service]
EnvironmentFile=-/etc/default/named
ExecStart=/usr/sbin/named -f $OPTIONS
ExecReload=/usr/sbin/rndc reload
ExecStop=/usr/sbin/rndc stop
Restart=on-failure
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..?
 
Old 02-09-2023, 02:32 AM   #5
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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.
 
Old 02-11-2023, 08:01 AM   #6
md303
LQ Newbie
 
Registered: Dec 2016
Posts: 9

Original Poster
Rep: Reputation: Disabled
Hello,

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.

Thank you.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
running ntp in the foreground pgb205 Linux - Server 1 06-15-2016 01:22 AM
cp 8.19: running it in the background, does it show the errors on the foreground? stf92 Slackware 5 06-05-2014 11:09 PM
Questions about background/foreground running processes Vexe Linux - General 7 03-06-2013 08:24 AM
how can a program tell if it is running in foreground? aryek Linux - Software 1 07-08-2009 09:08 PM
Unable to Automount ISO image unless automount is running in foreground! swests Linux - General 4 05-22-2009 12:47 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration