summaryrefslogtreecommitdiff
path: root/server/server.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-10-21 13:57:35 -0400
committerSimo Sorce <idra@samba.org>2008-10-21 13:57:35 -0400
commitc38fcbf3df0131caebec0ce0414fc409b63e9d93 (patch)
treea6efbfb88ef5b4402a5d67581e53f0eec2881a72 /server/server.c
parent85f827f25a879a4499180d61742ba6bc22b04ccc (diff)
downloadsssd-c38fcbf3df0131caebec0ce0414fc409b63e9d93.tar.gz
sssd-c38fcbf3df0131caebec0ce0414fc409b63e9d93.tar.bz2
sssd-c38fcbf3df0131caebec0ce0414fc409b63e9d93.zip
Make return the pid when new process are started.
Monitor each service and restart it conditionally if it fails. These monitoring is extremely simple at this moment and just uses waitpid() to check if the client is alive, there is no active probing, that will require dbus. Make nsssrv.c read the sss pipe config option for the config db.
Diffstat (limited to 'server/server.c')
-rw-r--r--server/server.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/server/server.c b/server/server.c
index 683b039d..b6664e1d 100644
--- a/server/server.c
+++ b/server/server.c
@@ -33,6 +33,7 @@
#include "../ldb/include/ldb.h"
#include "service.h"
#include "confdb/confdb.h"
+#include "monitor.h"
extern void monitor_task_init(struct task_server *task);
extern void nss_task_init(struct task_server *task);
@@ -119,7 +120,6 @@ int main(int argc, const char *argv[])
TALLOC_CTX *mem_ctx;
uint16_t stdin_event_flags;
int status;
- char **services;
enum {
OPT_DAEMON = 1000,
@@ -213,23 +213,14 @@ int main(int argc, const char *argv[])
discard_const(argv[0]));
/* Services */
- register_server_service("monitor", monitor_task_init);
register_server_service("nss", nss_task_init);
- status = confdb_get_param(confdb_ctx, mem_ctx, "config.services",
- "activeServices", &services);
-
- if (services[0] == NULL) {
- DEBUG(0, ("No services configured!\n"));
- return 2;
+ /* the monitor starts the services */
+ status = start_monitor(mem_ctx, event_ctx, confdb_ctx);
+ if (status != EOK) {
+ return 1;
}
- status = server_service_startup(event_ctx, (const char **)services);
- if (status != EOK) {
- DEBUG(0,("Starting Services failed - %d\n", status));
- return 1;
- }
-
/* wait for events - this is where smbd sits for most of its
life */
event_loop_wait(event_ctx);