Fix for issue #3814 : start-ds script return before server has started
| | |
| | | # CDDL HEADER END |
| | | # |
| | | # |
| | | # Copyright 2006-2008 Sun Microsystems, Inc. |
| | | # Copyright 2006-2009 Sun Microsystems, Inc. |
| | | |
| | | |
| | | # Capture the current working directory so that we can change to it later. |
| | |
| | | if test ${EC} -eq 99 |
| | | then |
| | | "${OPENDS_JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \ |
| | | --targetFile "${STARTING_FILE}" --logFile "${LOG_FILE}" |
| | | --targetFile "${STARTING_FILE}" --logFile "${LOG_FILE}" "${@}" |
| | | else |
| | | "${OPENDS_JAVA_BIN}" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete \ |
| | | --targetFile "${STARTING_FILE}" |
| | | --targetFile "${STARTING_FILE}" "${@}" |
| | | fi |
| | | EC=${?} |
| | | if test ${EC} -eq 0 |
| | |
| | | exit 1 |
| | | fi |
| | | fi |
| | | exit ${?} |
| | | exit ${EC} |
| | | else |
| | | if test ${EC} -eq 100 |
| | | then |
| | |
| | | rem CDDL HEADER END |
| | | rem |
| | | rem |
| | | rem Copyright 2006-2008 Sun Microsystems, Inc. |
| | | rem Copyright 2006-2009 Sun Microsystems, Inc. |
| | | |
| | | setlocal |
| | | for %%i in (%~sf0) do set DIR_HOME=%%~dPsi.. |
| | |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %* |
| | | goto checkStarted |
| | | |
| | | :runDetachQuiet |
| | |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" %* >> %LOG% |
| | | goto checkStarted |
| | | |
| | | :runDetachCalledByWinService |
| | |
| | | if exist "%INSTANCE_ROOT%\lib\set-java-args.bat" DO call "%INSTANCE_ROOT%\lib\set-java-args.bat" |
| | | "%INSTALL_ROOT%\lib\winlauncher.exe" start "%INSTANCE_ROOT%" "%OPENDS_JAVA_BIN%" -Xrs %OPENDS_JAVA_ARGS% %SCRIPT_NAME_ARG% org.opends.server.core.DirectoryServer --configClass org.opends.server.extensions.ConfigFileHandler --configFile "%INSTANCE_ROOT%\config\config.ldif" %* |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.out" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" --outputFile "%INSTANCE_ROOT%\logs\winservice.out" |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.starting" --logFile "%INSTANCE_ROOT%\logs\server.out" --outputFile "%INSTANCE_ROOT%\logs\winservice.out" %* |
| | | erase "%INSTANCE_ROOT%\logs\server.startingservice" |
| | | goto checkStarted |
| | | |
| | |
| | | echo %SCRIPT%: Run as service >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.StartWindowsService |
| | | echo %SCRIPT%: Waiting for "%INSTANCE_ROOT%\logs\server.startingservice" to be deleted >> %LOG% |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice" |
| | | "%OPENDS_JAVA_BIN%" -Xms8M -Xmx8M org.opends.server.tools.WaitForFileDelete --targetFile "%INSTANCE_ROOT%\logs\server.startingservice" %* |
| | | rem Type the contents the winwervice.out file and delete it. |
| | | if exist "%INSTANCE_ROOT%\logs\winservice.out" type "%INSTANCE_ROOT%\logs\winservice.out" |
| | | if exist "%INSTANCE_ROOT%\logs\winservice.out" erase "%INSTANCE_ROOT%\logs\winservice.out" |
| | |
| | | # |
| | | # CDDL HEADER END |
| | | # |
| | | # Copyright 2006-2008 Sun Microsystems, Inc. |
| | | # Copyright 2006-2009 Sun Microsystems, Inc. |
| | | |
| | | |
| | | |
| | |
| | | SEVERE_ERR_MODIFY_NO_MODIFICATIONS_566=Entry %s cannot be updated because the \ |
| | | request did not contain any modifications |
| | | INFO_DSCORE_DESCRIPTION_NODETACH_567=Do not detach from the terminal and \ |
| | | continue running in the foreground |
| | | continue running in the foreground. This option cannot be used with the \ |
| | | -t, --timeout option. |
| | | MILD_ERR_ENTRY_INCREMENT_NO_SUCH_ATTRIBUTE_568=Unable to increment the value \ |
| | | of attribute %s because that attribute does not exist in the entry |
| | | INFO_DSCORE_TOOL_DESCRIPTION_569=This utility can be used to start the \ |
| | |
| | | SEVERE_ERR_CRYPTOMGR_FAILED_INSTANCE_CERTIFICATE_NULL_721=The CryptoManager \ |
| | | entry "%s" (the instance-key-pair public-key-certificate) does not contain \ |
| | | a public-key certificate |
| | | |
| | | INFO_DSCORE_DESCRIPTION_TIMEOUT_722=Maximum time (in seconds) to wait before \ |
| | | the command returns (the server continues the startup process, regardless). \ |
| | | A value of '0' indicates an infinite timeout, which means that the command \ |
| | | returns only when the server startup is completed. The default value is \ |
| | | 60 seconds. This option cannot be used with the -N, --nodetach option. |
| | | FATAL_ERR_DSCORE_ERROR_NODETACH_TIMEOUT_723=In no-detach mode, the 'timeout' option \ |
| | | cannot be used. |
| | |
| | | import org.opends.server.util.args.ArgumentException; |
| | | import org.opends.server.util.args.ArgumentParser; |
| | | import org.opends.server.util.args.BooleanArgument; |
| | | import org.opends.server.util.args.IntegerArgument; |
| | | import org.opends.server.util.args.StringArgument; |
| | | import org.opends.server.workflowelement.WorkflowElement; |
| | | import org.opends.server.workflowelement.WorkflowElementConfigManager; |
| | |
| | | // Define the arguments that may be provided to the server. |
| | | BooleanArgument checkStartability = null; |
| | | BooleanArgument quietMode = null; |
| | | IntegerArgument timeout = null; |
| | | BooleanArgument windowsNetStart = null; |
| | | BooleanArgument displayUsage = null; |
| | | BooleanArgument fullVersion = null; |
| | |
| | | argParser.addArgument(quietMode); |
| | | |
| | | |
| | | // Not used in this class, but required by the start-ds script |
| | | // (see issue #3814) |
| | | timeout = new IntegerArgument("timeout", 't', "timeout", true, false, |
| | | true, INFO_SECONDS_PLACEHOLDER.get(), 60, |
| | | null, true, 0, false, |
| | | 0, INFO_DSCORE_DESCRIPTION_TIMEOUT.get()); |
| | | argParser.addArgument(timeout); |
| | | |
| | | displayUsage = new BooleanArgument("help", 'H', "help", |
| | | INFO_DSCORE_DESCRIPTION_USAGE.get()); |
| | | argParser.addArgument(displayUsage); |
| | |
| | | RuntimeInformation.printInfo(); |
| | | return; |
| | | } |
| | | else if (noDetach.isPresent() && timeout.isPresent()) { |
| | | Message message = ERR_DSCORE_ERROR_NODETACH_TIMEOUT.get(); |
| | | System.err.println(message); |
| | | System.err.println(argParser.getUsage()); |
| | | System.exit(1); |
| | | } |
| | | |
| | | |
| | | // At this point, we know that we're going to try to start the server. |
| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2006-2008 Sun Microsystems, Inc. |
| | | * Copyright 2006-2009 Sun Microsystems, Inc. |
| | | */ |
| | | package org.opends.server.tools; |
| | | import org.opends.messages.Message; |
| | |
| | | import org.opends.server.util.args.StringArgument; |
| | | |
| | | import static org.opends.messages.ToolMessages.*; |
| | | import static org.opends.messages.CoreMessages.*; |
| | | import static org.opends.server.util.ServerConstants.*; |
| | | import static org.opends.server.util.StaticUtils.*; |
| | | |
| | |
| | | StringArgument logFilePath = null; |
| | | StringArgument targetFilePath = null; |
| | | StringArgument outputFilePath = null; |
| | | BooleanArgument useLastKnownGoodConfig = null; |
| | | BooleanArgument quietMode = null; |
| | | |
| | | Message toolDescription = INFO_WAIT4DEL_TOOL_DESCRIPTION.get(); |
| | | ArgumentParser argParser = new ArgumentParser(CLASS_NAME, toolDescription, |
| | |
| | | argParser.addArgument(timeout); |
| | | |
| | | |
| | | // Not used in this class, but required by the start-ds script |
| | | // (see issue #3814) |
| | | useLastKnownGoodConfig = |
| | | new BooleanArgument("lastknowngoodconfig", 'L', |
| | | "useLastKnownGoodConfig", |
| | | INFO_DSCORE_DESCRIPTION_LASTKNOWNGOODCFG.get()); |
| | | argParser.addArgument(useLastKnownGoodConfig); |
| | | |
| | | // Not used in this class, but required by the start-ds script |
| | | // (see issue #3814) |
| | | quietMode = new BooleanArgument("quiet", 'Q', "quiet", |
| | | INFO_DESCRIPTION_QUIET.get()); |
| | | argParser.addArgument(quietMode); |
| | | |
| | | showUsage = new BooleanArgument("help", 'H', "help", |
| | | INFO_WAIT4DEL_DESCRIPTION_HELP.get()); |
| | | argParser.addArgument(showUsage); |