summaryrefslogtreecommitdiffstats
path: root/server/monitor
diff options
context:
space:
mode:
Diffstat (limited to 'server/monitor')
-rw-r--r--server/monitor/monitor.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/server/monitor/monitor.c b/server/monitor/monitor.c
index 3c393c97d..d797ae0e2 100644
--- a/server/monitor/monitor.c
+++ b/server/monitor/monitor.c
@@ -28,6 +28,7 @@
#include "popt.h"
#include "tevent.h"
#include "confdb/confdb.h"
+#include "db/sysdb.h"
#include "monitor/monitor.h"
#include "dbus/dbus.h"
#include "sbus/sssd_dbus.h"
@@ -365,6 +366,7 @@ int monitor_process_init(TALLOC_CTX *mem_ctx,
{
struct mt_ctx *ctx;
struct mt_svc *svc;
+ struct sysdb_ctx *sysdb;
const char **doms;
int dom_count;
char *path;
@@ -382,6 +384,18 @@ int monitor_process_init(TALLOC_CTX *mem_ctx,
if (ret != EOK)
return ret;
+ /* Avoid a startup race condition between InfoPipe
+ * and NSS. If the sysdb doesn't exist yet, both
+ * will try to create it at the same time. So
+ * we'll have the monitor create it before either of
+ * those processes start.
+ */
+ ret = sysdb_init(mem_ctx, ctx->ev, ctx->cdb,
+ NULL, &sysdb);
+ if (ret != EOK)
+ return ret;
+ talloc_free(sysdb);
+
/* Initialize D-BUS Server
* The monitor will act as a D-BUS server for all
* SSSD processes */