Bugzilla bug 119340: backed out the fix. We are still seeing the
"selfserv process not detectable" errors on Linux and I don't have time to get to the bottom of it. Modified files: cmd/selfserv/selfserv.c tests/common/init.sh tests/ssl/ssl.sh git-svn-id: svn://10.0.0.236/trunk@113271 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
1031af74be
commit
52cd995d98
@ -141,15 +141,6 @@ static int requestCert;
|
||||
static int verbose;
|
||||
static SECItem bigBuf;
|
||||
|
||||
static const char *pidFile;
|
||||
/*
|
||||
* On Linux, the first thread we create writes its pid to a file.
|
||||
* (See bug 119340 for why we do this.)
|
||||
*/
|
||||
#ifdef LINUX
|
||||
static PRInt32 threadIndex;
|
||||
#endif
|
||||
|
||||
static PRThread * acceptorThread;
|
||||
|
||||
static PRLogModuleInfo *lm;
|
||||
@ -429,27 +420,6 @@ thread_wrapper(void * arg)
|
||||
{
|
||||
perThread * slot = (perThread *)arg;
|
||||
|
||||
#ifdef LINUX /* bug 119403 */
|
||||
if (pidFile && PR_AtomicIncrement(&threadIndex) == 1) {
|
||||
char *pidFile2;
|
||||
FILE *tmpfile;
|
||||
|
||||
pidFile2 = PORT_Alloc(PORT_Strlen(pidFile) + 3);
|
||||
if (pidFile2 == NULL) {
|
||||
return; /* failed */
|
||||
}
|
||||
strcpy(pidFile2, pidFile);
|
||||
strcat(pidFile2, ".2");
|
||||
tmpfile=fopen(pidFile2,"w+");
|
||||
|
||||
if (tmpfile) {
|
||||
fprintf(tmpfile,"%d",getpid());
|
||||
fclose(tmpfile);
|
||||
}
|
||||
PORT_Free(pidFile2);
|
||||
}
|
||||
#endif /* LINUX */
|
||||
|
||||
slot->rv = (* slot->startFunc)(slot->a, slot->b, slot->c);
|
||||
|
||||
/* notify the thread exit handler. */
|
||||
@ -1414,6 +1384,7 @@ main(int argc, char **argv)
|
||||
char * cipherString= NULL;
|
||||
const char * dir = ".";
|
||||
char * passwd = NULL;
|
||||
const char * pidFile = NULL;
|
||||
char * tmp;
|
||||
char * envString;
|
||||
PRFileDesc * listen_sock;
|
||||
|
||||
@ -141,29 +141,13 @@ wait_for_selfserv()
|
||||
########################################################################
|
||||
kill_selfserv()
|
||||
{
|
||||
# Bug 119340: This is an inelegant but more reliable way to ensure
|
||||
# that a multithreaded process on Linux has been completely killed.
|
||||
# Recall that each thread is a process on Linux. Instead of killing
|
||||
# the primary thread, we kill the first thread created by selfserv and
|
||||
# let the thread manager take care of terminating the other threads in
|
||||
# selfserv. The assumption we rely on is that the primary thread is
|
||||
# the last one to go because it's the parent of the thread manager.
|
||||
#
|
||||
# On Linux, the first thread created by selfserv writes its pid to the
|
||||
# {SERVERPID}.2 file.
|
||||
if [ "${OS_ARCH}" = "Linux" ]; then
|
||||
${KILL} `cat ${SERVERPID}.2`
|
||||
else
|
||||
${KILL} `cat ${SERVERPID}`
|
||||
fi
|
||||
${KILL} `cat ${SERVERPID}`
|
||||
wait `cat ${SERVERPID}`
|
||||
if [ ${fileout} -eq 1 ]; then
|
||||
cat ${SERVEROUTFILE}
|
||||
fi
|
||||
${SLEEP} #FIXME linux waits 30 seconds - find a shorter way (sockets free)
|
||||
rm ${SERVERPID}
|
||||
if [ "${OS_ARCH}" = "Linux" ]; then
|
||||
rm ${SERVERPID}.2
|
||||
fi
|
||||
}
|
||||
|
||||
########################### start_selfserv #############################
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user