winlauncher.c revision b1dce270ec218b8ad86ce6d745d295da038a5c88
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER START
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * The contents of this file are subject to the terms of the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Common Development and Distribution License, Version 1.0 only
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * (the "License"). You may not use this file except in compliance
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * with the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * You can obtain a copy of the license at legal-notices/CDDLv1_0.txt
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * See the License for the specific language governing permissions
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * and limitations under the License.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * When distributing Covered Code, include this CDDL HEADER in each
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * file and include the License file at legal-notices/CDDLv1_0.txt.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * If applicable, add the following below this CDDL HEADER, with the
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * fields enclosed by brackets "[]" replaced with your own identifying
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * information:
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * Portions Copyright [yyyy] [name of copyright owner]
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync * CDDL HEADER END
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync* Copyright 2008 Sun Microsystems, Inc.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync// ----------------------------------------------------
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync// Generates the pid file name for a given instanceDir.
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync// Returns TRUE if the command name could be initiated and
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync// FALSE otherwise (buffer overflow because the resulting
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync// string is bigger than maxSize).
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync// ----------------------------------------------------
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsyncBOOL getPidFile(const char* instanceDir, char* pidFile, unsigned int maxSize)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync debug("Attempting to get the PID file for instanceDir='%s'", instanceDir);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync if ((strlen(relativePath) + strlen(instanceDir)) < maxSize)
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync sprintf(pidFile, "%s\\logs\\server.pid", instanceDir);
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync debugError("Unable to get the PID file name because the path was too long.");
14ea49401f3c8c61422aefbda43809e275f60c6cvboxsync} // getPidFile
return returnValue;
nTries--;
return returnValue;
int returnValue;
FILE *f;
int read;
if (f != NULL)
fclose(f);
returnValue = 0;
returnValue = 0;
return returnValue;
nTries--;
debug("Process (pid=%d) has not yet exited. Sleeping for 1 second and will try %d more time(s).", pid, nTries);
return processDead;
FILE *f;
fclose (f);
return returnValue;
int curCmdInd = 0;
int argInd = 0;
argInd++;
if (overflow)
return !overflow;
// (see stop.c).
int returnValue;
int childPid;
if (childPid > 0)
debugError("Couldn't start the child process because the full command line could not be constructed.");
return returnValue;
// Note: even if the code in the class org.opends.server.core.DirectoryServer
int childPid;
if (childPid != 0)
returnCode = 0;
debug("Could not stop the server running at root '%s' because the pid could not be located.", instanceDir);
return returnCode;
int returnValue;
if (returnValue <= 0)
debugError("Couldn't launch the child process because the full command line could not be constructed.");
return returnValue;
int waitedMillis = 0;
if(createOk)
return returnValue;
int returnCode;
for (i = 0; i < argc; i++) {
char * msg =
return returnCode;