diff --git a/man/Xserver.man b/man/Xserver.man index 2b2114ac6..192ae4eb4 100644 --- a/man/Xserver.man +++ b/man/Xserver.man @@ -54,7 +54,8 @@ The X server may also be started directly by the user, though this method is usually reserved for testing and is not recommended for normal operation. On some platforms, the user must have special permission to start the X server, often because access to certain -devices (e.g. \fI/dev/mouse\fP) is restricted. +devices (e.g. \fI/dev/mouse\fP) is restricted. Where applicable, the +X server notifies systemd when it is ready to process requests. .PP When the X server starts up, it typically takes over the display. If you are running on a workstation whose console is the display, you may diff --git a/os/connection.c b/os/connection.c index fd4f9c0ed..5a05d7a1d 100644 --- a/os/connection.c +++ b/os/connection.c @@ -116,6 +116,10 @@ SOFTWARE. #define zoneid_t int #endif +#ifdef HAVE_SYSTEMD_DAEMON +#include +#endif + #include "probes.h" struct ospoll *server_poll; @@ -207,6 +211,11 @@ NotifyParentProcess(void) } if (RunFromSigStopParent) raise(SIGSTOP); +#ifdef HAVE_SYSTEMD_DAEMON + /* If we have been started as a systemd service, tell systemd that + we are ready. Otherwise sd_notify() won't do anything. */ + sd_notify(0, "READY=1"); +#endif #endif }