steffen: server/kolab/kolab kolab_bootstrap,1.52,1.53
cvs at intevation.de
cvs at intevation.de
Thu Aug 5 02:58:47 CEST 2004
Author: steffen
Update of /kolabrepository/server/kolab/kolab
In directory doto:/tmp/cvs-serv8541/kolab
Modified Files:
kolab_bootstrap
Log Message:
sanity check when bootstrapping the slave
Index: kolab_bootstrap
===================================================================
RCS file: /kolabrepository/server/kolab/kolab/kolab_bootstrap,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -d -r1.52 -r1.53
--- kolab_bootstrap 16 Jul 2004 12:40:13 -0000 1.52
+++ kolab_bootstrap 5 Aug 2004 00:58:45 -0000 1.53
@@ -589,23 +589,31 @@
$php_dn = "cn=nobody,$base_dn";
$mesg = $ldap->search(base=> $php_dn, scope=> 'exact', filter=> "(objectclass=*)");
if ($mesg && $mesg->count != 1) {
- print "Nobody object found, please check your input\n";
+ print "Nobody object not found, please check your input\n";
goto SLAVESTART;
}
my $entry = $mesg->entry(0);
$php_pw = $entry->get_value( 'userPassword' );
- # Get ldap database from master
-# print <<'EOS';
-#Now we need to ssh to the master server,
-#temporarily stop the LDAP server,
-#copy the LDAP database files to the slave and
-#restart the master LDAP server again\n\n";
-#This will be done as root. Type in the root password or
-#passphrase when asked
-#EOS
+ $mesg = $ldap->search(base=> "k=kolab,$base_dn", scope=> 'exact',
+ filter=> "(objectClass=*)");
+ if ($mesg && $mesg->count != 1) {
+ print "No Kolab object found, please check your input\n";
+ goto SLAVESTART;
+ }
+ my $kolabhosts = $mesg->entry(0)->get_value( 'kolabhost', asref => 1 );
+ foreach(@$kolabhosts) {
+ if( lc($_) eq lc($fqdn) ) {
+ goto SLAVEOK;
+ }
+ }
+ print "$fqdn is not listed on the master, please correct that and try again\n";
+ goto SLAVESTART;
+
+ SLAVEOK:
my $master_host = $ldapuri->host();
+
$fd = IO::File->new($kolab_config, "w+") || die "could not open $kolab_config";
print $fd "fqhostname : $fqdn\n";
More information about the commits
mailing list