svn commit: samba r7493 - in branches/SAMBA_4_0/source/smbd: .
tridge at samba.org
tridge at samba.org
Sun Jun 12 00:17:23 GMT 2005
Author: tridge
Date: 2005-06-12 00:17:23 +0000 (Sun, 12 Jun 2005)
New Revision: 7493
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7493
Log:
add a --maximum-runtime option to smbd. If this time is exceeeded then it exits.
This will be used in the build farm
Modified:
branches/SAMBA_4_0/source/smbd/server.c
Changeset:
Modified: branches/SAMBA_4_0/source/smbd/server.c
===================================================================
--- branches/SAMBA_4_0/source/smbd/server.c 2005-06-11 17:55:58 UTC (rev 7492)
+++ branches/SAMBA_4_0/source/smbd/server.c 2005-06-12 00:17:23 UTC (rev 7493)
@@ -137,7 +137,19 @@
}
}
+
/*
+ die if the user selected maximum runtime is exceeded
+*/
+static void max_runtime_handler(struct event_context *ev, struct timed_event *te,
+ struct timeval t, void *private)
+{
+ DEBUG(0,("smbd maximum runtime exceeded - terminating\n"));
+ exit(0);
+}
+
+
+/*
main server.
*/
static int binary_smbd_main(int argc, const char *argv[])
@@ -148,6 +160,7 @@
struct event_context *event_ctx;
NTSTATUS status;
const char *model = "standard";
+ int max_runtime = 0;
struct poptOption long_options[] = {
POPT_AUTOHELP
POPT_COMMON_SAMBA
@@ -155,6 +168,8 @@
"Run interactive (not a daemon)", NULL},
{"model", 'M', POPT_ARG_STRING, &model, True,
"Select process model", "MODEL"},
+ {"maximum-runtime", 0, POPT_ARG_INT, &max_runtime, True,
+ "set maximum time for smbd to live", "seconds"},
POPT_COMMON_VERSION
POPT_TABLEEND
};
@@ -222,6 +237,13 @@
server_stdin_handler, NULL);
}
+
+ if (max_runtime) {
+ event_add_timed(event_ctx, event_ctx,
+ timeval_current_ofs(max_runtime, 0),
+ max_runtime_handler, NULL);
+ }
+
DEBUG(0,("Using %s process model\n", model));
status = server_service_startup(event_ctx, model, lp_server_services());
if (!NT_STATUS_IS_OK(status)) {
More information about the samba-cvs
mailing list