|
|
@ -101,7 +101,24 @@ if ( $opt->{pre} ) { |
|
|
|
log_info("No service were shutted down"); |
|
|
|
log_info("No service were shutted down"); |
|
|
|
} elsif ($opt->{shutdown} eq 'ldap' and -e '/opt/zimbra/bin/ldap'){ |
|
|
|
} elsif ($opt->{shutdown} eq 'ldap' and -e '/opt/zimbra/bin/ldap'){ |
|
|
|
log_info("Starting Zimbra LDAP service"); |
|
|
|
log_info("Starting Zimbra LDAP service"); |
|
|
|
|
|
|
|
my $try = 0; |
|
|
|
|
|
|
|
my $running = 0; |
|
|
|
|
|
|
|
while ($try < 20) { |
|
|
|
system("/opt/zimbra/bin/ldap start"); |
|
|
|
system("/opt/zimbra/bin/ldap start"); |
|
|
|
|
|
|
|
sleep 1; |
|
|
|
|
|
|
|
if (system("/opt/zimbra/bin/ldap status") == 0){ |
|
|
|
|
|
|
|
$running = 1; |
|
|
|
|
|
|
|
last; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
log_info('ldap service not running, trying again to start it'); |
|
|
|
|
|
|
|
$try++; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
# Couldn't start ldap ? Restart all the services |
|
|
|
|
|
|
|
if (not $running){ |
|
|
|
|
|
|
|
log_info("Failed to restart ldap, restarting all Zimbra services"); |
|
|
|
|
|
|
|
system('systemctl restart zimbra'); |
|
|
|
|
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
log_info("Starting Zimbra services"); |
|
|
|
log_info("Starting Zimbra services"); |
|
|
|
system('systemctl start zimbra'); |
|
|
|
system('systemctl start zimbra'); |
|
|
|