how can we restart bind-9.14.11

Reindl Harald h.reindl at thelounge.net
Mon Mar 16 14:04:52 UTC 2020



Am 16.03.20 um 14:58 schrieb Reindl Harald:
> 
> 
> Am 16.03.20 um 14:48 schrieb ShubhamGoyal:
>>  Dear sir,
>>                            I installed bind version 9.14.11 by tar file
>> . it is working okk.
>>                             i tried
>>                             1. systemctl restart named
>>                              2.  /etc/rc.d/init.d/bind restart
>>                              3.  service named restart
>>  
>>                             But I do not able to restart service.
>>                               please tell me how can i restart bind 9.14.11
> 
> by write a simple systemd-unit and forget about /etc/rc.d and most
> important: by not start it by hand to begin with because systemd has no
> clue about random processes
> 
> [root at srv-rhsoft:~]$ cat /etc/systemd/system/named.service
> [Unit]
> Description=DNS Server
> 
> [Service]
> Type=simple
> ExecStart=/usr/sbin/named -4 -f -u named -t /var/named/chroot
> ExecReload=/usr/bin/kill -HUP $MAINPID
> ExecStop=/usr/bin/kill -TERM $MAINPID
> TimeoutSec=25
> Restart=always
> RestartSec=1
> 
> PrivateTmp=yes
> ReadOnlyPaths=/etc
> ReadOnlyPaths=/usr
> 
> 
> [Install]
> WantedBy=multi-user.target

adjust "ExecStart=/usr/sbin/named -4 -f -u named -t /var/named/chroot"
to match your path and most likely remove the "-t" (chroot) option
unless you provide ExecStartPre stuff is stripped out by purpose

a simple systemd unit looks like below

 -f Run the server in the foreground (i.e. do not daemonize)

foreground is needed for "Type=simple" so that the process don't fork -
no need to do so unless you have services strictly ordered after
named.service

--------------------------------------

[Unit]
Description=DNS Server

[Service]
Type=simple
ExecStart=/path/your-binary

[Install]
WantedBy=multi-user.target

--------------------------------------


More information about the bind-users mailing list