2020/05/24 14:30:19 Authorization passed for xxxx from xxx.xxx.xxx.xxx
2020/05/24 14:30:19 Reloaded xxxx.nl from master xxx.xxx.xxx.xxx
2020/05/24 14:30:27 RNDC queue triggered with 1 events
2020/05/24 14:30:27 RNDC output: server reload successful
/usr/sbin/rndc reload xxxx.nl
background 1
host *
port 2222
sslport 2224
ssl off
ssl_cert /usr/local/directslave/ssl/fullchain.pem
ssl_key /usr/local/directslave/ssl/privkey.pem
cookie_sess_id DS_SESSID
cookie_auth_key xxxxxxx
debug 1
uid 117 # bind
gid 123 # bind
pid /usr/local/directslave/run/directslave.pid
access_log /usr/local/directslave/log/access.log
error_log /usr/local/directslave/log/error.log
action_log /usr/local/directslave/log/action.log
named_workdir /var/cache/bind
named_conf /var/cache/bind/directslave.inc
retry_time 1
rndc_path /usr/sbin/rndc
named_format text
authfile /usr/local/directslave/etc/passwd
// This is the primary configuration file for the BIND DNS server named.
//
// Please read /usr/share/doc/bind9/README.Debian.gz for information on the
// structure of BIND configuration files in Debian, *BEFORE* you customize
// this configuration file.
//
// If you are just adding zones, please do that in /etc/bind/named.conf.local
include "/etc/bind/named.conf.options";
include "/etc/bind/named.conf.local";
include "/etc/bind/named.conf.default-zones";
include "/var/cache/bind/directslave.inc";
options {
directory "/var/cache/bind";
// If there is a firewall between you and nameservers you want
// to talk to, you may need to fix the firewall to allow multiple
// ports to talk. See http://www.kb.cert.org/vuls/id/800113
// If your ISP provided one or more IP addresses for stable
// nameservers, you probably want to use them as forwarders.
// Uncomment the following block, and insert the addresses replacing
// the all-0's placeholder.
// forwarders {
// 0.0.0.0;
// };
allow-query { any; };
allow-notify { xxx.xxx.xxx.xxx; }; // master server ip
allow-update { xxx.xxx.xxx.xxx; }; // master server ip
allow-transfer { none; };
allow-recursion { none;};
recursion no;
//========================================================================
// If BIND logs error messages about the root key being expired,
// you will need to update your keys. See https://www.isc.org/bind-keys
//========================================================================
dnssec-validation auto;
listen-on-v6 { any; };
};
logging {
channel default_debug {
file "/var/cache/bind/default_debug.log";
severity dynamic;
};
};
Hi,
I am new to this. So sorry for any stupid questions. I am running this on Cento 8 but when I restart the VPS the DirectSlave does not auto restart. How do I enable it to restart on system reboot?
[root@server5 ~]# systemctl status directslave
● directslave.service - DirectSlave for DirectAdmin
Loaded: loaded (/etc/systemd/system/directslave.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since Wed 2020-07-01 21:23:18 BST; 11h ago
Process: 2443 ExecStart=/usr/local/directslave/bin/directslave --run (code=exited, status=203/EXEC)
Main PID: 2443 (code=exited, status=203/EXEC)
Jul 01 21:23:17 systemd[1]: directslave.service: Main process exited, code=exited, status=203/EXEC
Jul 01 21:23:17 systemd[1]: directslave.service: Failed with result 'exit-code'.
Jul 01 21:23:18 systemd[1]: directslave.service: Service RestartSec=100ms expired, scheduling resta>
Jul 01 21:23:18 systemd[1]: directslave.service: Scheduled restart job, restart counter is at 5.
Jul 01 21:23:18 systemd[1]: Stopped DirectSlave for DirectAdmin.
Jul 01 21:23:18 systemd[1]: directslave.service: Start request repeated too quickly.
Jul 01 21:23:18 systemd[1]: directslave.service: Failed with result 'exit-code'.
Jul 01 21:23:18 systemd[1]: Failed to start DirectSlave for DirectAdmin.
[ICODE]
My systemd config file:
[CODE]
[root@server5 ~]# cat /etc/systemd/system/directslave.service
[Unit]
Description=DirectSlave for DirectAdmin
After=network.target
[Service]
Type=simple
User=named
ExecStart=/usr/local/directslave/bin/directslave --run
Restart=always
[Install]
WantedBy=multi-user.target
[root@server5 etc]# cat directslave.conf
background 1
host <obscured>
port 2222
ssl off
cookie_sess_id DS_SESSID
cookie_auth_key <obscured>
debug 0
uid 25
gid 25
pid /usr/local/directslave/run/directslave.pid
access_log /usr/local/directslave/log/access.log
error_log /usr/local/directslave/log/error.log
action_log /usr/local/directslave/log/action.log
named_workdir /etc/namedb/secondary
named_conf /etc/namedb/directslave.inc
retry_time 1200
rndc_path /usr/sbin/rndc
named_format text
authfile /usr/local/directslave/etc/passwd
In console I assume you start it as root, so my question would be, in the config have you checked the uid and gid to be the correct one?
The service start as user "named" so that might cause an issue if uid and gid are not for the user named.
[root@server5 etc]# cat /etc/passwd | grep named
named:x:25:25:Named:/var/named:/bin/false
When you start it manually do you use this command?
/usr/local/directslave/bin/directslave --run
[Unit]
Description=DirectSlave
After=network.target
[Service]
Type=simple
ExecStart=/usr/local/directslave/bin/directslave --run
Restart=always
[Install]
WantedBy=multi-user.target
Maybe you need to remove the "User" line, I checked my config and this is what I use:
Code:[Unit] Description=DirectSlave After=network.target [Service] Type=simple ExecStart=/usr/local/directslave/bin/directslave --run Restart=always [Install] WantedBy=multi-user.target
to my slave named.conf i get error starting bind:include "/usr/local/directslave/etc/directslave.conf";
bind9.service - BIND Domain Name Server
Loaded: loaded (/lib/systemd/system/bind9.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Wed 2020-07-29 15:35:36 BST; 1s ago
Docs: man:named(8)
Process: 7860 ExecStop=/usr/sbin/rndc stop (code=exited, status=1/FAILURE)
Process: 7854 ExecStart=/usr/sbin/named -f $OPTIONS (code=exited, status=1/FAILURE)
Main PID: 7854 (code=exited, status=1/FAILURE)
Jul 29 15:35:36 ns4 named[7854]: using up to 4096 sockets
Jul 29 15:35:36 ns4 named[7854]: loading configuration from '/etc/bind/named.conf'
Jul 29 15:35:36 ns4 named[7854]: /usr/local/directslave/etc/directslave.conf:1: unknown option 'background'
Jul 29 15:35:36 ns4 named[7854]: /etc/bind/named.conf:13: unexpected token near end of file
Jul 29 15:35:36 ns4 named[7854]: loading configuration: unexpected token
Jul 29 15:35:36 ns4 systemd[1]: bind9.service: Main process exited, code=exited, status=1/FAILURE
Jul 29 15:35:36 ns4 rndc[7860]: rndc: connect failed: 127.0.0.1#953: connection refused
You should check the top of that directslave.conf file, what's in it. Because for some reason it contains the word background. It should only consist of lines starting with: zone "example.com"{ .../usr/local/directslave/etc/directslave.conf:1: unknown option 'background'