DirectSlave - solution to add and remove zones on slave without DirectAdmin

It's not creating the zone file.

They shouldn't, because 'master' mode is deprecated in since DS 2.х. It works in 'slave' by default. Check new records in file 'named_conf', they created as
Code:
zone "domain_name" { type slave; file "/named_db_path/domain_name.db";  masters { your_primary_IP; }; max-retry-time 1200; min-retry-time 1200; };

right?

If so, you must setup AXFR right on your primary, or downgrade to 1.3 to continue to use 'master' mode.
 
DirectSlave 'master' mode: second birth or not?

I must return a 'master' mode and mix it up with multiuser in DS 2.2, I think, because many of DS users install it as 'master' without configuring any of AXFRs, and because this is really handy for basic DNS users who doesn't want to set up anything but DirectAdmin default installation (and that's right not to touch the working system by the hands without really need). What do you think, guys?
 
I dont get honestly the difference... i did just a fresh install directly from 2.2 ( i did use older in past but stopped use for multiple-user feature miss ).. but now i did setup DS in really few minutes...

I think that you should stay on the new "mode" and user who want to upgrade fit the new requirement.

Re-Sync all DNS from DA is very fast, is boring just when someone does have many servers, but, my idea would be restore a basic named.conf, empty the zoen .db files.. and let da resync all.. that's my opinion, someone else should not agree with me.

Regards
 
BTW, this is the init.d script for CentOS ;)

Code:
#!/bin/sh

# directslave daemon            Start/Stop/Status/Restart

# chkconfig: 2345 80 20
# description: Allow you to use DirectAdmin Multi-Server function \
#              without need to have a DirectAdmin license, \
#              for manage external DNS Server.
# processname: directslave
# config: /usr/local/directslave/etc/directslave.conf
# pidfile: /usr/local/directslave/run/directslave.pid

# Source function library
. /etc/rc.d/init.d/functions

PROGBIN="/usr/local/directslave/bin/directslave --run"
PROGLOCK=/var/lock/subsys/directslave
PROGNAME=directslave

#check the command line for actions

start() {
        echo -n "Starting DirectSlave: "
        daemon $PROGBIN
        echo
        touch $PROGLOCK
}

stop() {
        echo -n "Stopping DirectSlave: "
        killproc $PROGNAME
        echo
        rm -f $PROGLOCK
}

reload() {
        echo -n "Reloading DirectSlave config file: "
        killproc $PROGNAME -HUP
        echo
}
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        status)
                status $PROGNAME
                ;;
        restart)
                stop
                start
                ;;
        reload)
                reload
                ;;
        *)
                echo "Usage: $1 {start|stop|status|reload|restart}"
                exit 1
esac

exit 0

Is definitly a basic one (toook from the DirectAdmin one) if you think can be somehow adjusted, feel free to edit it.

Best regards
 
BTW, this is the init.d script for CentOS ;)

Code:
#!/bin/sh

# directslave daemon            Start/Stop/Status/Restart

# chkconfig: 2345 80 20
# description: Allow you to use DirectAdmin Multi-Server function \
#              without need to have a DirectAdmin license, \
#              for manage external DNS Server.
# processname: directslave
# config: /usr/local/directslave/etc/directslave.conf
# pidfile: /usr/local/directslave/run/directslave.pid

# Source function library
. /etc/rc.d/init.d/functions

PROGBIN="/usr/local/directslave/bin/directslave --run"
PROGLOCK=/var/lock/subsys/directslave
PROGNAME=directslave

#check the command line for actions

start() {
        echo -n "Starting DirectSlave: "
        daemon $PROGBIN
        echo
        touch $PROGLOCK
}

stop() {
        echo -n "Stopping DirectSlave: "
        killproc $PROGNAME
        echo
        rm -f $PROGLOCK
}

reload() {
        echo -n "Reloading DirectSlave config file: "
        killproc $PROGNAME -HUP
        echo
}
case "$1" in
        start)
                start
                ;;
        stop)
                stop
                ;;
        status)
                status $PROGNAME
                ;;
        restart)
                stop
                start
                ;;
        reload)
                reload
                ;;
        *)
                echo "Usage: $1 {start|stop|status|reload|restart}"
                exit 1
esac

exit 0

Is definitly a basic one (toook from the DirectAdmin one) if you think can be somehow adjusted, feel free to edit it.

Best regards

Woohoo, thanks! Looks like the one from ancient FreeBSD 4.х :-)

Do CentOS have global config file, like FreeBSD /etc/rc.conf ?
 
I think that you should stay on the new "mode" and user who want to upgrade fit the new requirement.

Re-Sync all DNS from DA is very fast, is boring just when someone does have many servers, but, my idea would be restore a basic named.conf, empty the zoen .db files.. and let da resync all.. that's my opinion, someone else should not agree with me.

Regards

Thanks for you opinion, I'll note it :-)
 
CentOS does have /etc/rc.d/rc but if you wanna just set it for startup so:

1 - copy the directslave init script to /etc/init.d/

than run:

Code:
chkconfig --add directslave
chkconfig directslave on

Regards
 
There are a few zones created now, but only 1/5 of them.
I think there is a permission issue, but I don't know where.
 
Last edited:
I have no experience (yet) with DirectSlave, but I don't see how you could hve a permissions problem with some of the domains yet not othrs, if they were all created using the same instructions.

However you can easily test this by checking the ownership and permissions of all files owned by a working domain with the path and any files of one which doesn't.

You can also check the /var/log/messages log to see if it's logging any errors when trying to slave the domains which aren't working.

Jeff
 
I have no experience (yet) with DirectSlave, but I don't see how you could hve a permissions problem with some of the domains yet not othrs, if they were all created using the same instructions.

However you can easily test this by checking the ownership and permissions of all files owned by a working domain with the path and any files of one which doesn't.

You can also check the /var/log/messages log to see if it's logging any errors when trying to slave the domains which aren't working.

Jeff

Well, /var/log/messages says this:

named[1738]: zone [DOMAIN]/IN: refresh: could not set file modification time of '/var/named/[DOMAIN].db': permission denied
 
If recursion means what I think it mean, then it shouldn't have anything to do with file ;permissions; recursion simply tells the server if it's not authoritative it can ask another nameserver. And an authoritative nameserver used by DirectAdmin should never allow recursion; it's a DOS security risk.

Are you sure you didn't do anything else?

Where did you set recursion to yes?

Can you replicate the problem by commenting out the line and then restarting BIND, and when you do, does the problem reoccur?

Jeff
 
CentOS does have /etc/rc.d/rc but if you wanna just set it for startup so:

1 - copy the directslave init script to /etc/init.d/

than run:

Code:
chkconfig --add directslave
chkconfig directslave on

Regards
when DS starts the first time (in CentOS) this is shown:
Code:
Starting DirectSlave: Pid_file "/usr/local/directslave/run/directslave.pid" already exists.  Overwriting!
(even after reboot)
 
when DS starts the first time (in CentOS) this is shown:
Code:
Starting DirectSlave: Pid_file "/usr/local/directslave/run/directslave.pid" already exists.  Overwriting!
(even after reboot)

It's OK, because DS runned with --check option created own .pid file (for permission testing purposes). Ignore this message, it's not a bug, just for info. Also, if DS is already running and pidfile contains live pid, DS will not duplicate itself and does not start in that case.
 
I will do this when I schedule maintenance.

If recursion means what I think it mean, then it shouldn't have anything to do with file ;permissions; recursion simply tells the server if it's not authoritative it can ask another nameserver. And an authoritative nameserver used by DirectAdmin should never allow recursion; it's a DOS security risk.

Are you sure you didn't do anything else?

Where did you set recursion to yes?

Can you replicate the problem by commenting out the line and then restarting BIND, and when you do, does the problem reoccur?

Jeff
 
Im having trouble using this I tried both versions and always get an error when trying it.
[root@slave directslave]# /usr/local/directslave/bin/directslave
defined(@array) is deprecated at /usr/local/directslave/bin/../lib/DSGI.pm line 528.
(Maybe you should just omit the defined()?)
[root@slave directslave]#
 
Okay, I must read docs periodically.
Here is a patch:

Code:
--- DSGI.pm.orig 2013-11-20 12:59:32.000000000 +0200
+++ DSGI.pm 2013-11-20 12:55:03.000000000 +0200
@@ -525,7 +525,7 @@
     # if we get called more than once, we want to initialize
     # ourselves from the original query (which may be gone
     # if it was read from STDIN originally.)
-    if (defined(@QUERY_PARAM) && !defined($initializer)) {
+    if (@QUERY_PARAM && !defined($initializer)) {
         for my $name (@QUERY_PARAM) {
             my $val = $QUERY_PARAM{$name}; # always an arrayref;
             $self->param('-name'=>$name,'-value'=> $val);
 
Last edited:
Back
Top