summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2008-11-25 11:24:12 -0500
committerSimo Sorce <idra@samba.org>2008-11-25 15:41:31 -0500
commitf85ae5fce84ad7bdc515c1ec324b9c56cb1a39b2 (patch)
tree96423e1f020f3fec29b64ad4478b71d2bd26c37c /server
parentc40a333b2ce23e7cec692bac3ca547f78fadd731 (diff)
downloadsssd-f85ae5fce84ad7bdc515c1ec324b9c56cb1a39b2.tar.gz
sssd-f85ae5fce84ad7bdc515c1ec324b9c56cb1a39b2.tar.xz
sssd-f85ae5fce84ad7bdc515c1ec324b9c56cb1a39b2.zip
Remove the service stuff that we stopped using when we moved to
the forl/exec model
Diffstat (limited to 'server')
-rw-r--r--server/nss/nsssrv.c1
-rw-r--r--server/process.c127
-rw-r--r--server/process.h13
-rw-r--r--server/providers/data_provider.c1
-rw-r--r--server/server.c7
-rw-r--r--server/service.c97
-rw-r--r--server/service.h48
-rw-r--r--server/service_proto.h23
-rw-r--r--server/service_task.c90
-rw-r--r--server/service_task.h32
10 files changed, 3 insertions, 436 deletions
diff --git a/server/nss/nsssrv.c b/server/nss/nsssrv.c
index 67aae9ea1..ab1ef441d 100644
--- a/server/nss/nsssrv.c
+++ b/server/nss/nsssrv.c
@@ -31,7 +31,6 @@
#include <errno.h>
#include "ldb.h"
#include "util/util.h"
-#include "service.h"
#include "nss/nsssrv.h"
#include "nss/nsssrv_ldb.h"
#include "confdb/confdb.h"
diff --git a/server/process.c b/server/process.c
deleted file mode 100644
index ebe6ba1e6..000000000
--- a/server/process.c
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- Based on process_standard.c from samba4
-
- Copyright (C) Andrew Tridgell 1992-2005
- Copyright (C) James J Myers 2003 <myersjj@samba.org>
- Copyright (C) Stefan (metze) Metzmacher 2004
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <unistd.h>
-#include "../events/events.h"
-#include "../tdb/include/tdb.h"
-#include "../talloc/talloc.h"
-#include "util/util.h"
-
-#ifdef HAVE_SETPROCTITLE
-#ifdef HAVE_SETPROCTITLE_H
-#include <setproctitle.h>
-#endif
-#else
-#define setproctitle none_setproctitle
-static int none_setproctitle(const char *fmt, ...) PRINTF_ATTRIBUTE(1, 2);
-static int none_setproctitle(const char *fmt, ...)
-{
- return 0;
-}
-#endif
-
-/*
- called to create a new server task
-*/
-int process_new_task(struct event_context *ev,
- const char *service_name,
- void (*new_task)(struct event_context *, void *),
- void *private,
- pid_t *rpid)
-{
- pid_t pid;
- struct event_context *ev2;
-
- pid = fork();
-
- if (pid != 0) {
- int res;
-
- /* parent */
- res = EOK;
-
- if (pid == -1) {
- /* error */
- res = ECHILD;
- }
-
- if (rpid) {
- *rpid = pid;
- }
-
- /* ... go back to the event loop */
- return res;
- }
-
- pid = getpid();
-
- /* This is now the child code. We need a completely new event_context to work with */
- ev2 = event_context_init(NULL);
-
- /* the service has given us a private pointer that
- encapsulates the context it needs for this new connection -
- everything else will be freed */
- talloc_steal(ev2, private);
-
- /* this will free all the listening sockets and all state that
- is not associated with this new connection */
- talloc_free(ev);
-
- /* tdb needs special fork handling */
- if (tdb_reopen_all(1) == -1) {
- DEBUG(0,("process_new_task: tdb_reopen_all failed.\n"));
- }
-
- setproctitle("task %s server_id[%d]", service_name, pid);
-
- /* setup this new task. */
- new_task(ev2, private);
-
- /* we can't return to the top level here, as that event context is gone,
- so we now process events in the new event context until there are no
- more to process */
- event_loop_wait(ev2);
-
- talloc_free(ev2);
- exit(0);
-}
-
-
-/* called when a task goes down */
-void process_terminate(struct event_context *ev, const char *reason)
-{
- DEBUG(2,("process_terminate: reason[%s]\n",reason));
-
- talloc_free(ev);
-
- /* terminate this process */
- exit(0);
-}
-
-/* called to set a title of a task or connection */
-void process_set_title(struct event_context *ev, const char *title)
-{
- if (title) {
- setproctitle("%s", title);
- } else {
- setproctitle(NULL);
- }
-}
diff --git a/server/process.h b/server/process.h
deleted file mode 100644
index be22a562d..000000000
--- a/server/process.h
+++ /dev/null
@@ -1,13 +0,0 @@
-#ifndef __SSSD_PROCESS_H__
-#define __SSSD_PROCESS_H__
-
-int process_new_task(struct event_context *ev,
- const char *service_name,
- void (*new_task)(struct event_context *, void *),
- void *private,
- pid_t *rpid);
-void process_set_title(struct event_context *ev, const char *title);
-void process_terminate(struct event_context *ev, const char *reason);
-
-#endif /* __SSSD_PROCESS_H__ */
-
diff --git a/server/providers/data_provider.c b/server/providers/data_provider.c
index f29f828cf..aacb09ef8 100644
--- a/server/providers/data_provider.c
+++ b/server/providers/data_provider.c
@@ -32,7 +32,6 @@
#include "ldb.h"
#include "ldb_errors.h"
#include "util/util.h"
-#include "service.h"
#include "confdb/confdb.h"
#include "dbus/dbus.h"
#include "sbus/sssd_dbus.h"
diff --git a/server/server.c b/server/server.c
index aef1b8d31..f5cd9ea71 100644
--- a/server/server.c
+++ b/server/server.c
@@ -1,7 +1,7 @@
-/*
- Unix SMB/CIFS implementation.
+/*
+ SSSD
- Main SMB server routines
+ Servers setup routines
Copyright (C) Andrew Tridgell 1992-2005
Copyright (C) Martin Pool 2002
@@ -31,7 +31,6 @@
#include "util/util.h"
#include "../events/events.h"
#include "../ldb/include/ldb.h"
-#include "service.h"
#include "confdb/confdb.h"
#include "providers/providers.h"
#include "monitor.h"
diff --git a/server/service.c b/server/service.c
deleted file mode 100644
index 56a09712d..000000000
--- a/server/service.c
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- Based on:
- SERVER SERVICE code from samba4
-
- Copyright (C) Andrew Tridgell 2003-2005
- Copyright (C) Stefan (metze) Metzmacher 2004
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include <strings.h>
-#include "util/util.h"
-#include "../talloc/talloc.h"
-#include "../events/events.h"
-#include "service.h"
-
-/*
- a linked list of registered servers
-*/
-static struct registered_server {
- struct registered_server *next, *prev;
- const char *service_name;
- void (*task_init)(struct task_server *);
-} *registered_servers;
-
-/*
- register a server service.
-*/
-int register_server_service(const char *name,
- void (*task_init)(struct task_server *))
-{
- struct registered_server *srv;
- srv = talloc(talloc_autofree_context(), struct registered_server);
- if (NULL == srv) return ENOMEM;
- srv->service_name = name;
- srv->task_init = task_init;
- DLIST_ADD_END(registered_servers, srv, struct registered_server *);
- return EOK;
-}
-
-
-/*
- initialise a server service
-*/
-int server_service_init(const char *name,
- struct event_context *ev,
- pid_t *rpid)
-{
- struct registered_server *srv;
- for (srv=registered_servers; srv; srv=srv->next) {
- if (strcasecmp(name, srv->service_name) == 0) {
- return task_server_startup(ev,
- srv->service_name,
- srv->task_init, rpid);
- }
- }
- return EINVAL;
-}
-
-
-/*
- startup all of our server services
-*/
-int server_service_startup(struct event_context *event_ctx,
- const char **server_services)
-{
- int i;
-
- if (!server_services) {
- DEBUG(0,("server_service_startup: no endpoint servers configured\n"));
- return EINVAL;
- }
-
- for (i = 0; server_services[i]; i++) {
- int status;
-
- status = server_service_init(server_services[i], event_ctx, NULL);
- if (status != EOK) {
- DEBUG(0,("Failed to start service '%s'\n",
- server_services[i]));
- return status;
- }
- }
-
- return EOK;
-}
diff --git a/server/service.h b/server/service.h
deleted file mode 100644
index 6f1a1388f..000000000
--- a/server/service.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- SERVER SERVICE code
-
- Copyright (C) Andrew Tridgell 2003-2005
- Copyright (C) Stefan (metze) Metzmacher 2004
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __SERVICE_H__
-#define __SERVICE_H__
-
-#include "service_task.h"
-
-/* The following definitions come from service.c */
-
-int register_server_service(const char *name,
- void (*task_init)(struct task_server *));
-int server_service_startup(struct event_context *event_ctx,
- const char **server_services);
-int server_service_init(const char *name,
- struct event_context *ev,
- pid_t *rpid);
-
-/* The following definitions come from service_task.c */
-
-int task_server_startup(struct event_context *event_ctx,
- const char *service_name,
- void (*task_init)(struct task_server *),
- pid_t *rpid);
-void task_server_set_title(struct task_server *task, const char *title);
-void task_server_terminate(struct task_server *task, const char *reason);
-
-#endif /* __SERVICE_H__ */
-
diff --git a/server/service_proto.h b/server/service_proto.h
deleted file mode 100644
index a42a32dcf..000000000
--- a/server/service_proto.h
+++ /dev/null
@@ -1,23 +0,0 @@
-#ifndef __SSSD_SERVICE_PROTO_H__
-#define __SSSD_SERVICE_PROTO_H__
-
-/* The following definitions come from service.c */
-
-NTSTATUS register_server_service(const char *name,
- void (*task_init)(struct task_server *));
-NTSTATUS server_service_startup(struct event_context *event_ctx,
- struct loadparm_context *lp_ctx,
- const char *model, const char **server_services);
-
-/* The following definitions come from service_task.c */
-
-void task_server_terminate(struct task_server *task, const char *reason);
-NTSTATUS task_server_startup(struct event_context *event_ctx,
- struct loadparm_context *lp_ctx,
- const char *service_name,
- const struct model_ops *model_ops,
- void (*task_init)(struct task_server *));
-void task_server_set_title(struct task_server *task, const char *title);
-
-#endif /* __SSSD_SERVICE_PROTO_H__ */
-
diff --git a/server/service_task.c b/server/service_task.c
deleted file mode 100644
index 364aa6f89..000000000
--- a/server/service_task.c
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- helper functions for task based servers (nbtd, winbind etc)
-
- Copyright (C) Andrew Tridgell 2005
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "../talloc/talloc.h"
-#include "../events/events.h"
-#include "util/util.h"
-#include "process.h"
-#include "service.h"
-#include "service_task.h"
-
-/*
- terminate a task service
-*/
-void task_server_terminate(struct task_server *task, const char *reason)
-{
- struct event_context *event_ctx = task->event_ctx;
- process_terminate(event_ctx, reason);
-
- /* don't free this above, it might contain the 'reason' being printed */
- talloc_free(task);
-}
-
-/* used for the callback from the process model code */
-struct task_state {
- void (*task_init)(struct task_server *);
-};
-
-
-/*
- called by the process model code when the new task starts up. This then calls
- the server specific startup code
-*/
-static void task_server_callback(struct event_context *event_ctx, void *private)
-{
- struct task_state *state = talloc_get_type(private, struct task_state);
- struct task_server *task;
-
- task = talloc(event_ctx, struct task_server);
- if (task == NULL) return;
-
- task->event_ctx = event_ctx;
-
- /* TODO: Init task messaging here */
-
- state->task_init(task);
-}
-
-/*
- startup a task based server
-*/
-int task_server_startup(struct event_context *event_ctx,
- const char *service_name,
- void (*task_init)(struct task_server *),
- pid_t *rpid)
-{
- struct task_state *state;
-
- state = talloc(event_ctx, struct task_state);
- if (NULL == state) return ENOMEM;
-
- state->task_init = task_init;
-
- return process_new_task(event_ctx, service_name, task_server_callback, state, rpid);
-}
-
-/*
- setup a task title
-*/
-void task_server_set_title(struct task_server *task, const char *title)
-{
- process_set_title(task->event_ctx, title);
-}
diff --git a/server/service_task.h b/server/service_task.h
deleted file mode 100644
index 1e523a14e..000000000
--- a/server/service_task.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- Unix SMB/CIFS implementation.
-
- structures for task based servers
-
- Copyright (C) Andrew Tridgell 2005
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef __SERVICE_TASK_H__
-#define __SERVICE_TASK_H__
-
-struct task_server {
- struct event_context *event_ctx;
- void *private;
-};
-
-
-
-#endif /* __SERVICE_TASK_H__ */