Mailinglist Archive: yast-commit (1095 mails)

< Previous Next >
[yast-commit] r52247 - /trunk/ldap-server/src/LdapServer.pm
  • From: rhafer@xxxxxxxxxxxxxxxx
  • Date: Wed, 15 Oct 2008 12:47:45 -0000
  • Message-id: <20081015124745.9690AF4EB7@xxxxxxxxxxxxxxxx>
Author: rhafer
Date: Wed Oct 15 14:47:45 2008
New Revision: 52247

URL: http://svn.opensuse.org/viewcvs/yast?rev=52247&view=rev
Log:
restart slapd when needed (bnc#435625)

Modified:
trunk/ldap-server/src/LdapServer.pm

Modified: trunk/ldap-server/src/LdapServer.pm
URL:
http://svn.opensuse.org/viewcvs/yast/trunk/ldap-server/src/LdapServer.pm?rev=52247&r1=52246&r2=52247&view=diff
==============================================================================
--- trunk/ldap-server/src/LdapServer.pm (original)
+++ trunk/ldap-server/src/LdapServer.pm Wed Oct 15 14:47:45 2008
@@ -35,6 +35,7 @@
my %error = ( msg => undef, details => undef );
my $usingDefaults = 1;
my $readConfig = 0;
+my $restartRequired = 0;
my $configured = 0;
my $usesBackConfig = 0;
my $slapdConfChanged = 0;
@@ -686,30 +687,54 @@
Progress->New("Writing OpenLDAP Configuration", "", 5, $progressItems,
$progressItems, "");
Progress->NextStage();

- # these changes might require a restart of slapd
+ # these changes require a restart of slapd
if ( $use_ldap_listener )
{
- SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAP', 'yes');
+ if (SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAP') eq "no" )
+ {
+ SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAP', 'yes');
+ $restartRequired = 1;
+ }
}
else
{
- SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAP', 'no');
+ if (SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAP') eq "yes" )
+ {
+ SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAP', 'no');
+ $restartRequired = 1;
+ }
}
if ( $use_ldapi_listener )
{
- SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPI', 'yes');
+ if (SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAPI') eq "no" )
+ {
+ SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPI', 'yes');
+ $restartRequired = 1;
+ }
}
else
{
- SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPI', 'no');
+ if (SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAPI') eq "yes"
)
+ {
+ SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPI', 'no');
+ $restartRequired = 1;
+ }
}
if ( $use_ldaps_listener )
{
- SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPS', 'yes');
+ if (SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAPS') eq "no" )
+ {
+ SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPS', 'yes');
+ $restartRequired = 1;
+ }
}
else
{
- SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPS', 'no');
+ if (SCR->Read('.sysconfig.openldap.OPENLDAP_START_LDAPS') eq "yes"
)
+ {
+ SCR->Write('.sysconfig.openldap.OPENLDAP_START_LDAPS', 'no');
+ $restartRequired = 1;
+ }
}
my $progress_orig = Progress->set(0);
SuSEFirewall->Write();
@@ -750,6 +775,10 @@
}

Progress->Finish();
+ if ( $restartRequired )
+ {
+ Service->Restart("ldap");
+ }
}
sleep(1);
$configured = $ret;
@@ -1176,6 +1205,14 @@
return 0;
}
}
+ my $oldtls = $self->ReadTlsConfig();
+ if ( $oldtls->{'certKeyFile'} ne $tls->{'certKeyFile'} ||
+ $oldtls->{'certFile'} ne $tls->{'certFile'} ||
+ $oldtls->{'caCertFile'} ne $tls->{'caCertFile'})
+ {
+ $restartRequired = 1;
+ }
+
my $rc = SCR->Write('.ldapserver.global.tlsSettings', $tls );
return 1;
}

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages