#include "param/secrets.h"
#include "smbd/pidfile.h"
#include "param/param.h"
+#include "dsdb/samdb/samdb.h"
+#include "auth/session.h"
/*
recursively delete a directory tree
kill(-getpgrp(), SIGTERM);
}
#endif
+ DEBUG(0,("Exiting pid %d on SIGTERM\n", (int)getpid()));
exit(0);
}
DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name));
#if HAVE_GETPGRP
if (getpgrp() == getpid()) {
+ DEBUG(0,("Sending SIGTERM from pid %d\n", (int)getpid()));
kill(-getpgrp(), SIGTERM);
}
#endif
exit(0);
}
+/*
+ pre-open the sam ldb to ensure the schema has been loaded. This
+ saves a lot of time in child processes
+ */
+static void prime_samdb_schema(struct tevent_context *event_ctx)
+{
+ TALLOC_CTX *samdb_context;
+ samdb_context = talloc_new(event_ctx);
+ samdb_connect(samdb_context, event_ctx, cmdline_lp_ctx, system_session(samdb_context, cmdline_lp_ctx));
+ talloc_free(samdb_context);
+}
+
/*
main server.
*/
extern NTSTATUS server_service_cldapd_init(void);
extern NTSTATUS server_service_smb_init(void);
extern NTSTATUS server_service_drepl_init(void);
+ extern NTSTATUS server_service_kcc_init(void);
extern NTSTATUS server_service_rpc_init(void);
extern NTSTATUS server_service_ntp_signd_init(void);
extern NTSTATUS server_service_samba3_smb_init(void);
discard_const(binary_name));
}
+ prime_samdb_schema(event_ctx);
+
DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
status = server_service_startup(event_ctx, cmdline_lp_ctx, model,
lp_server_services(cmdline_lp_ctx));