diff --git a/include/opaque.h b/include/opaque.h index b3c7c70d6..dfe440cdc 100644 --- a/include/opaque.h +++ b/include/opaque.h @@ -55,6 +55,7 @@ extern _X_EXPORT int defaultBackingStore; extern _X_EXPORT Bool disableBackingStore; extern _X_EXPORT Bool enableBackingStore; extern _X_EXPORT Bool PartialNetwork; +extern _X_EXPORT Bool RunFromSigStopParent; #ifndef NOLOGOHACK extern _X_EXPORT int logoScreenSaver; #endif diff --git a/os/connection.c b/os/connection.c index 77910be52..28cd1935c 100644 --- a/os/connection.c +++ b/os/connection.c @@ -146,6 +146,8 @@ Bool NewOutputPending; /* not yet attempted to write some new output */ Bool AnyClientsWriteBlocked; /* true if some client blocked on write */ static Bool RunFromSmartParent; /* send SIGUSR1 to parent process */ +Bool RunFromSigStopParent; /* send SIGSTOP to our own process; Upstart (or + equivalent) will send SIGCONT back. */ Bool PartialNetwork; /* continue even if unable to bind all addrs */ static Pid_t ParentProcess; @@ -357,6 +359,8 @@ NotifyParentProcess(void) kill (ParentProcess, SIGUSR1); } } + if (RunFromSigStopParent) + raise (SIGSTOP); #endif } diff --git a/os/utils.c b/os/utils.c index 51455cca1..f30674ba5 100644 --- a/os/utils.c +++ b/os/utils.c @@ -527,6 +527,7 @@ void UseMsg(void) #endif ErrorF("-dumbSched Disable smart scheduling, enable old behavior\n"); ErrorF("-schedInterval int Set scheduler interval in msec\n"); + ErrorF("-sigstop Enable SIGSTOP based startup\n"); ErrorF("+extension name Enable extension\n"); ErrorF("-extension name Disable extension\n"); #ifdef XDMCP @@ -922,6 +923,10 @@ ProcessCommandLine(int argc, char *argv[]) else UseMsg (); } + else if ( strcmp( argv[i], "-sigstop") == 0) + { + RunFromSigStopParent = TRUE; + } else if ( strcmp( argv[i], "+extension") == 0) { if (++i < argc)