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

I was still talking about CPAN.

There is no point to check on DirectSlave untill the problem with CPAN and this Perl packages isn't fixed.

Regards

i dont know how to fix it((

Code:
mv /root/.cpan/ /root/.cpan_OLD/
[root@ns2 ~]# yum-y reinstall perl-CPAN
Modules are loaded: fastestmirror
base | 3.6 kB 00:00:00     
epel/x86_64/metalink | 21 kB 00:00:00     
epel | 4.3 kB 00:00:00     
extras | 3.4 kB 00:00:00     
updates | 3.4 kB 00:00:00     
(1/3): epel/x86_64/updateinfo | 512 kB 00:00:00     
(2/3): epel/x86_64/primary_db | 3.9 MB 00:00:00     
(3/3): updates/7/x86_64/primary_db | 3.2 MB 00:00:00     
Loading mirror speeds from cached hostfile
 * base: centos.serverspace.co.uk
 * epel: epel.mirrors.ovh.net
 * extras: centos.serverspace.co.uk
 * updates:                                                                                                                                                                                                                                                           | 3.4 kB  00:00:00     
(1/3): epel/x86_64/updateinfo                                                                                                                                                                                                                                       | 512 kB  00:00:00     
(2/3): epel/x86_64/primary_db                                                                                                                                                                                                                                       | 3.9 MB  00:00:00     
(3/3): updates/7/x86_64/primary_db                                                                                                                                                                                                                                  | 3.2 MB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: centos.serverspace.co.uk
 * epel: epel.mirrors.ovh.net
 * extras: centos.serverspace.co.uk
 * updates: centos.serverspace.co.uk
Permit of dependences
-> Check of the script
---> the Package perl-CPAN.noarch 0:1.9800-286.el7 is marked for reinstallation
-> Check of dependences is ended

Dependences are certain

                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
 Package Architecture the Version the Repository the Size
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
Reinstallation:
 perl-CPAN noarch 1.9800-286.el7 base 292 k

Total for operation
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    
To reinstall 1 package

Volume of loading: 292 k
Volume of variations: 745 k
Downloading packages:
perl-CPAN--1.9800-286.el7.noarch.rpm | 292 kB 00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installation: perl-CPAN--1.9800-286.el7.noarch 1/1 
  Check: perl-CPAN--1.9800-286.el7.noarch

It is established:
  perl-CPAN.noarch 0:1.9800-286.el7                                                                                                                                                                                                                                                        

It is executed!
[root@ns2 ~]# cpan

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes] yes

 <install_help>

Warning: You do not have write permission for Perl library directories.

To install modules, you need to configure a local Perl library directory or
escalate your privileges.  CPAN can help you by bootstrapping the local::lib
module or by configuring itself to use 'sudo' (if available).  You may also
resolve this problem manually if you need to customize your setup.

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')
 [local::lib] 

Autoconfigured everything but 'urllist'.

Now you need to choose your CPAN mirror sites.  You can let me
pick mirrors for you, you can select them from a list or you
can enter them by hand.

Would you like me to automatically choose some CPAN mirror
sites for you? (This means connecting to the Internet) [yes] 
Trying to fetch a mirror list from the Internet
Fetching with HTTP::Tiny:
http://www.perl.org/CPAN/MIRRORED.BY

Looking for CPAN mirrors near you (please be patient)
........................... done!

New urllist
  http://ftp.belnet.be/ftp.cpan.org/
  http://ftp.tudelft.nl/cpan/
  http://ftp.gwdg.de/pub/languages/perl/CPAN/

Autoconfiguration complete.

Attempting to bootstrap local::lib...

Writing /root/.cpan/CPAN/MyConfig.pm for bootstrap...
commit: wrote '/root/.cpan/CPAN/MyConfig.pm'
Fetching with HTTP::Tiny:
http://ftp.belnet.be/ftp.cpan.org/authors/01mailrc.txt.gz
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Fetching with HTTP::Tiny:
http://ftp.belnet.be/ftp.cpan.org/modules/0****kages.details.txt.gz
Reading '/root/.cpan/sources/modules/0****kages.details.txt.gz'
  Database was generated on Wed, 16 Mar 2016 10:53:38 GMT
  HTTP::Date not available
..............
  New CPAN.pm version (v2.10) available.
  [Currently running version is v1.9800]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


..............................................................DONE
Fetching with HTTP::Tiny:
http://ftp.belnet.be/ftp.cpan.org/modules/03modlist.data.gz
Reading '/root/.cpan/sources/modules/03modlist.data.gz'
Can't locate object method "data" via package "CPAN::Modulelist" (perhaps you forgot to load "CPAN::Modulelist"?) at (eval 25) line 1.
 at /usr/share/perl5/CPAN/Index.pm line 524.
	CPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl5/CPAN/Index.pm line 85
	CPAN::Index::reload('CPAN::Index') called at /usr/share/perl5/CPAN.pm line 976
	CPAN::exists('CPAN=HASH(0x21aca70)', 'CPAN::Module', 'local::lib') called at /usr/share/perl5/CPAN/Shell.pm line 1356
	CPAN::Shell::expand_by_method('CPAN::Shell', 'CPAN::Module', 'ARRAY(0x2548d08)', 'local::lib') called at /usr/share/perl5/CPAN/Shell.pm line 1273
	CPAN::Shell::expand('CPAN::Shell', 'Module', 'local::lib') called at /usr/share/perl5/CPAN/FirstTime.pm line 1257
	CPAN::FirstTime::init('/root/.cpan/CPAN/MyConfig.pm') called at /usr/share/perl5/CPAN/HandleConfig.pm line 580
	CPAN::HandleConfig::load('CPAN::HandleConfig') called at /usr/share/perl5/CPAN.pm line 259
	CPAN::shell() called at /usr/share/perl5/App/Cpan.pm line 295
	App::Cpan::_process_options('App::Cpan') called at /usr/share/perl5/App/Cpan.pm line 364
	App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11
[root@ns2 ~]# cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.

cpan[1]> install Bundle::CPAN
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Reading '/root/.cpan/sources/modules/0****kages.details.txt.gz'
  Database was generated on Wed, 16 Mar 2016 10:53:38 GMT
  HTTP::Date not available
..............
  New CPAN.pm version (v2.10) available.
  [Currently running version is v1.9800]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


..............................................................DONE
Reading '/root/.cpan/sources/modules/03modlist.data.gz'
Catching error: "Can't locate object method \"data\" via package \"CPAN::Modulelist\" (perhaps you forgot to load \"CPAN::Modulelist\"?) at (eval 19) line 1.\cJ at /usr/share/perl5/CPAN/Index.pm line 524.\cJ\cICPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl5/CPAN/Index.pm line 85\cJ\cICPAN::Index::reload('CPAN::Index') called at /usr/share/perl5/CPAN.pm line 976\cJ\cICPAN::exists('CPAN=HASH(0x26f2a70)', 'CPAN::Bundle', 'Bundle::CPAN') called at /usr/share/perl5/CPAN/Shell.pm line 1356\cJ\cICPAN::Shell::expand_by_method('CPAN::Shell', 'CPAN::Bundle', 'ARRAY(0x27fa868)', 'Bundle::CPAN') called at /usr/share/perl5/CPAN/Shell.pm line 1273\cJ\cICPAN::Shell::expand('CPAN::Shell', 'Bundle', 'Bundle::CPAN') called at /usr/share/perl5/CPAN/Shell.pm line 1254\cJ\cICPAN::Shell::expandany('CPAN::Shell', 'Bundle::CPAN') called at /usr/share/perl5/CPAN/Shell.pm line 1681\cJ\cICPAN::Shell::rematein('CPAN::Shell', 'install', 'Bundle::CPAN') called at /usr/share/perl5/CPAN/Shell.pm line 1977\cJ\cICPAN::Shell::__ANON__('CPAN::Shell', 'Bundle::CPAN') called at /usr/share/perl5/CPAN.pm line 376\cJ\cIeval {...} called at /usr/share/perl5/CPAN.pm line 373\cJ\cICPAN::shell() called at /usr/share/perl5/App/Cpan.pm line 295\cJ\cIApp::Cpan::_process_options('App::Cpan') called at /usr/share/perl5/App/Cpan.pm line 364\cJ\cIApp::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11\cJ" at /usr/share/perl5/CPAN.pm line 392.
	CPAN::shell() called at /usr/share/perl5/App/Cpan.pm line 295
	App::Cpan::_process_options('App::Cpan') called at /usr/share/perl5/App/Cpan.pm line 364
	App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Reading '/root/.cpan/sources/modules/0****kages.details.txt.gz'
Warning: Your /root/.cpan/sources/modules/0****kages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your /root/.cpan/sources/modules/0****kages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
.Could not split line["mMy�K�\e\cF��6\cU��%u�Z�y��o�u^��U�a��*\cU5SR���-X,�`w�"]
Could not split line["9�Z[:�=\cP#��'�Ew'�\c?�\cY\cG��3\@MI�S7\cG�s\cV��1}zB\cU���M"]
Could not split line["����d/4�\cR�a������\cA\c@\c@���]Qo�0\cP�+�\cC32�|&�d���%3{i��)�\cC\cB���\c_w�
                                                                                                   �^��L\cP���w=���\c\�i\\��h5��{����{��J�"]
Could not split line["\c@�\c]a>���\cA�\cE�K\cD`�"]
Giving up parsing your /root/.cpan/sources/modules/0****kages.details.txt.gz, too many errorsTerminal does not support GetHistory.
Lockfile removed.

[root@ns2 ~]# cpan
Terminal does not support AddHistory.

cpan shell -- CPAN exploration and modules installation (v1.9800)
Enter 'h' for help.

cpan[1]> install Net::Server:HTTP
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Reading '/root/.cpan/sources/modules/0****kages.details.txt.gz'
  Database was generated on Wed, 16 Mar 2016 10:53:38 GMT
  HTTP::Date not available
..............
  New CPAN.pm version (v2.10) available.
  [Currently running version is v1.9800]
  You might want to try
    install CPAN
    reload cpan
  to both upgrade CPAN.pm and run the new version without leaving
  the current session.


..............................................................DONE
Reading '/root/.cpan/sources/modules/03modlist.data.gz'
Catching error: "Can't locate object method \"data\" via package \"CPAN::Modulelist\" (perhaps you forgot to load \"CPAN::Modulelist\"?) at (eval 19) line 1.\cJ at /usr/share/perl5/CPAN/Index.pm line 524.\cJ\cICPAN::Index::rd_modlist('CPAN::Index', '/root/.cpan/sources/modules/03modlist.data.gz') called at /usr/share/perl5/CPAN/Index.pm line 85\cJ\cICPAN::Index::reload('CPAN::Index') called at /usr/share/perl5/CPAN.pm line 976\cJ\cICPAN::exists('CPAN=HASH(0x3338a70)', 'CPAN::Module', 'Net::Server:HTTP') called at /usr/share/perl5/CPAN/Shell.pm line 1256\cJ\cICPAN::Shell::expandany('CPAN::Shell', 'Net::Server:HTTP') called at /usr/share/perl5/CPAN/Shell.pm line 1681\cJ\cICPAN::Shell::rematein('CPAN::Shell', 'install', 'Net::Server:HTTP') called at /usr/share/perl5/CPAN/Shell.pm line 1977\cJ\cICPAN::Shell::__ANON__('CPAN::Shell', 'Net::Server:HTTP') called at /usr/share/perl5/CPAN.pm line 376\cJ\cIeval {...} called at /usr/share/perl5/CPAN.pm line 373\cJ\cICPAN::shell() called at /usr/share/perl5/App/Cpan.pm line 295\cJ\cIApp::Cpan::_process_options('App::Cpan') called at /usr/share/perl5/App/Cpan.pm line 364\cJ\cIApp::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11\cJ" at /usr/share/perl5/CPAN.pm line 392.
	CPAN::shell() called at /usr/share/perl5/App/Cpan.pm line 295
	App::Cpan::_process_options('App::Cpan') called at /usr/share/perl5/App/Cpan.pm line 364
	App::Cpan::run('App::Cpan') called at /usr/bin/cpan line 11
Reading '/root/.cpan/sources/authors/01mailrc.txt.gz'
............................................................................DONE
Reading '/root/.cpan/sources/modules/0****kages.details.txt.gz'
Warning: Your /root/.cpan/sources/modules/0****kages.details.txt.gz does not contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
Warning: Your /root/.cpan/sources/modules/0****kages.details.txt.gz does not contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
.Could not split line["mMy�K�\e\cF��6\cU��%u�Z�y��o�u^��U�a��*\cU5SR���-X,�`w�"]
Could not split line["9�Z[:�=\cP#��'�Ew'�\c?�\cY\cG��3\@MI�S7\cG�s\cV��1}zB\cU���M"]
Could not split line["����d/4�\cR�a������\cA\c@\c@���]Qo�0\cP�+�\cC32�|&�d���%3{i��)�\cC\cB���\c_w�
                                                                                                   �^��L\cP���w=���\c\�i\\��h5��{����{��J�"]
Could not split line["\c@�\c]a>���\cA�\cE�K\cD`�"]
Giving up parsing your /root/.cpan/sources/modules/0****kages.details.txt.gz, too many errorsTerminal does not support GetHistory.
Lockfile removed.
 
Last edited:
Try this way:

Code:
cd 
wget http://search.cpan.org/CPAN/authors/id/R/RH/RHANDOM/Net-Server-2.008.tar.gz
tar zxfv Net-Server-2.008.tar.gz
cd Net-Server-2.008
perl Makefile.PL
make 
make install

Than try if DirectSlave is working.

Regards
 
Try this way:

Code:
cd 
wget http://search.cpan.org/CPAN/authors/id/R/RH/RHANDOM/Net-Server-2.008.tar.gz
tar zxfv Net-Server-2.008.tar.gz
cd Net-Server-2.008
perl Makefile.PL
make 
make install

Than try if DirectSlave is working.

Regards

Many thanks, but now have problem with Daemonize.pm
Code:
/usr/local/directslave/bin/directslave --check
defined(@array) is deprecated at /usr/local/directslave/bin/../lib//DSGI.pm line 528.
	(Maybe you should just omit the defined()?)
Trying to create/open file 'access_log' -> /usr/local/directslave/log/access.log... 
OK.
Trying to create/open file 'action_log' -> /usr/local/directslave/log/action.log... 
OK.
Trying to create/open file 'error_log' -> /usr/local/directslave/log/error.log... 
OK.
Trying to create/open file 'named_conf' -> /etc/named/directslave.conf... 
OK.
Trying to create/open file 'pid' -> /usr/local/directslave/run/directslave.pid... 
OK.
[root@ns2 local]# /usr/local/directslave/bin/directslave --debug
defined(@array) is deprecated at /usr/local/directslave/bin/../lib//DSGI.pm line 528.
	(Maybe you should just omit the defined()?)
Config: $VAR1 = {
          'rndc_path' => '/usr/sbin/rndc',
          'retry_time' => '1200',
          'ssl_cert' => '/usr/local/directslave/ssl/server.crt',
          'named_conf' => '/etc/named/directslave.conf',
          'pid' => '/usr/local/directslave/run/directslave.pid',
          'ssl_key' => '/usr/local/directslave/ssl/server.key',
          'debug' => 1,
          'authfile' => '/usr/local/directslave/etc/passwd',
          'action_log' => '/usr/local/directslave/log/action.log',
          'server_type' => 'HTTP',
          'error_log' => '/usr/local/directslave/log/error.log',
          'uid' => 'root',
          'ssl' => 'on',
          'access_log' => '/usr/local/directslave/log/access.log',
          'background' => 0,
          'port' => '2222',
          'host' => '*',
          'sslport' => '2224',
          'named_workdir' => '/etc/named/secondary',
          'allow' => '0.0.0.0/0',
          'gid' => 'named'
        };
Listen ports: $VAR1 = [
          '2222',
          '2224/ssl'
        ];
Couldn't find pid in existing pid_file at /usr/local/share/perl5/Net/Server/Daemonize.pm line 48.
2016/03/17-09:03:01 Couldn't find pid in existing pid_file at /usr/local/share/perl5/Net/Server/Daemonize.pm line 48.

  at line 144 in file /usr/local/share/perl5/Net/Server.pm
2016/03/17-09:03:01 Server closing!
 
:/

May i ask why you've installed CentOS 7? :D

Should be pretty much easier and faster if you reinstall with a CentOS 6 or even CentOS 5.... Is that possible?

Regards
 
:/

May i ask why you've installed CentOS 7? :D

Should be pretty much easier and faster if you reinstall with a CentOS 6 or even CentOS 5.... Is that possible?

Regards

I can install only on CentOS 7 without reinstall because this server use for another tasks in production.
 
So i guess you need to wait for Roman to update the code or check the code by yourself.. apparently there are deprecated funcions that need to be changed to match new software version....

Perhaps someone else with a little perl scripting knowledge will reply :)

Regards
 
Did you already try the fix Roman gave several pages back? It did not work for somebody else, but that was not Centos 7.
Maybe it works in Centos 7 for you.
https://forum.directadmin.com/showthread.php?t=43924&page=7
look at post #140 in that thread.

I once fixed a kindlike CPAN problem, odd enough this worked, so really remove it completely before you do the reinstall:
Code:
yum remove perl
rm -rf /usr/lib/perl5
rm -rf /usr/lib64/perl5
yum -y reinstall perl

I hope it will do some good for you.
 
Did you already try the fix Roman gave several pages back? It did not work for somebody else, but that was not Centos 7.
Maybe it works in Centos 7 for you.
https://forum.directadmin.com/showthread.php?t=43924&page=7
look at post #140 in that thread.

I once fixed a kindlike CPAN problem, odd enough this worked, so really remove it completely before you do the reinstall:
Code:
yum remove perl
rm -rf /usr/lib/perl5
rm -rf /usr/lib64/perl5
yum -y reinstall perl

I hope it will do some good for you.

Thank you for posting, but dont help((
 
Zone db is not being created/transfered

I got almost everything to work, but running into a small issue. I am running Directslave on CentOS 6 with named (bind). The permission on named in CentOS is (user: root / group: named). My DirectAdmin server can see and connect to DirectSlave server. I can sync to DirectSlave server it adds the domain information to directslave.conf in namedb folder but it does not create .db zone files in the secondary folder. Any idea? I am so confused to what is going wrong since logs or anything else is not showing anything.

directslave.conf shows this

zone "mydomain.com" { type slave; file "/etc/namedb/secondary/mydomain.com.db"; masters { 111.111.111.111; }; max-retry-time 1200; min-retry-time 1200; };

/etc/namedb/secondary/mydomain.com.db is missing for some reason it is not creating this file

Thanks
 
So it's gid named, then this could work, because root has access to uid and gid named anyway.
But it might not be the problem.

You say Centos is running bind as rood:named.
If it works or not, depends what you have configured which uid and gid must be used to run Directslave. What did you use in directslave.conf?

Otherwise try running directslave in debug mode to see if any issues are occuring. Maybe debug is stating something.
 
Have you added the lines for allow-transfer and also-notify in named.conf on the directadmin box specifing the IP of the slave?

If not, named will not send zone information and neither the new updates for the zones ;)

Regards
 
Yes it sounds like bind on DA box isn't sending the records. The API / DirectSlave handles the base outline like specifying the zone file and master IP, so that the master can transfer the records themselves through BIND server <> BIND slave (using axfr).
 
Thanks guys. You were right I did have acl restriction in place for transfers. I have added my server IPs, so that is sorted out, but it is still not working. Does anyone have this running on CentOS? What UID and GID are you guys running this under? Also what permission do you have for these folders /etc/namedb, /etc/namedb/secondary?
 
Just any FYI if you are running this as UID root and GID named make sure secondary folder is set as permission 770.
 
That's the reason I asked how you had it configured in directslave.conf. I don't want an external application to run as root if not needed.
So in directslave.conf I configured Directslave to run als UID named and GID named.
Just chmodded the /etc/namedb/secondary directory to 755 since I use mod_ruid, and chowned it to named:named.
Works perfectly too.
 
Having an issue with DNSSEC and directslave.

After generating the key and signing the example.db disappeared from the slave and didn't get recreated, so I ran echo "action=rewrite&value=named" >> /usr/local/directadmin/data/task.queue, checked the slave and the .db files appeared again.

All zones dnssec signed are all okay on the master, tested and working, no errors.

What has got me lost shouldn't the example.com.db.signed also be transferred (axfr) to the slave, or doesn't that matter as long as its on the master. I got a feeling I'm missing something.
 
I've just installed DirectSlave on a Digital Ocean $5 droplet and it's working great.

Question: what's the best way to have DirectSlave automatically start on boot?

Thanks!
 
Back
Top