summaryrefslogtreecommitdiff
path: root/source4/smbd
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2005-12-15 18:08:25 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:25 -0500
commit3c145e05c7db58c4ff1e761932075cd4230e68aa (patch)
tree543e30952f215959f36446fad33357188387daa3 /source4/smbd
parent4bc1cc52ec40840afad95942aecf4841b3012451 (diff)
downloadsamba-3c145e05c7db58c4ff1e761932075cd4230e68aa.tar.gz
samba-3c145e05c7db58c4ff1e761932075cd4230e68aa.tar.bz2
samba-3c145e05c7db58c4ff1e761932075cd4230e68aa.zip
r12260: move the string "smbd" to one place
metze (This used to be commit dbb8f626706bc1d41d6629b04432a34840daa355)
Diffstat (limited to 'source4/smbd')
-rw-r--r--source4/smbd/server.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/source4/smbd/server.c b/source4/smbd/server.c
index cff1bc7068..3075896722 100644
--- a/source4/smbd/server.c
+++ b/source4/smbd/server.c
@@ -130,29 +130,29 @@ static void setup_signals(void)
static void server_stdin_handler(struct event_context *event_ctx, struct fd_event *fde,
uint16_t flags, void *private)
{
+ const char *binary_name = private;
uint8_t c;
if (read(0, &c, 1) == 0) {
- DEBUG(0,("smbd: EOF on stdin - terminating\n"));
+ DEBUG(0,("%s: EOF on stdin - terminating\n", binary_name));
exit(0);
}
}
-
/*
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"));
+ const char *binary_name = private;
+ DEBUG(0,("%s: maximum runtime exceeded - terminating\n", binary_name));
exit(0);
}
-
/*
main server.
*/
-static int binary_smbd_main(int argc, const char *argv[])
+static int binary_smbd_main(const char *binary_name, int argc, const char *argv[])
{
BOOL interactive = False;
int opt;
@@ -168,13 +168,13 @@ static int binary_smbd_main(int argc, const char *argv[])
{"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"},
+ "set maximum runtime of the server process, till autotermination", "seconds"},
POPT_COMMON_SAMBA
POPT_COMMON_VERSION
POPT_TABLEEND
};
-
- pc = poptGetContext("smbd", argc, argv, long_options, 0);
+
+ pc = poptGetContext(binary_name, argc, argv, long_options, 0);
while((opt = poptGetNextOpt(pc)) != -1) /* noop */ ;
@@ -187,7 +187,7 @@ static int binary_smbd_main(int argc, const char *argv[])
so set our umask to 0 */
umask(0);
- DEBUG(0,("smbd version %s started.\n", SAMBA_VERSION_STRING));
+ DEBUG(0,("%s version %s started.\n", binary_name, SAMBA_VERSION_STRING));
DEBUGADD(0,("Copyright Andrew Tridgell and the Samba Team 1992-2005\n"));
if (sizeof(uint16_t) < 2 || sizeof(uint32_t) < 4 || sizeof(uint64_t) < 8) {
@@ -206,7 +206,7 @@ static int binary_smbd_main(int argc, const char *argv[])
mkdir(lp_lockdir(), 0755);
}
- pidfile_create("smbd");
+ pidfile_create(binary_name);
/* Do *not* remove this, until you have removed
* passdb/secrets.c, and proved that Samba still builds... */
@@ -227,17 +227,19 @@ static int binary_smbd_main(int argc, const char *argv[])
signal(SIGTTIN, SIG_IGN);
#endif
event_add_fd(event_ctx, event_ctx, 0, EVENT_FD_READ,
- server_stdin_handler, NULL);
+ server_stdin_handler,
+ discard_const(binary_name));
}
if (max_runtime) {
event_add_timed(event_ctx, event_ctx,
timeval_current_ofs(max_runtime, 0),
- max_runtime_handler, NULL);
+ max_runtime_handler,
+ discard_const(binary_name));
}
- DEBUG(0,("Using %s process model\n", model));
+ DEBUG(0,("%s: using '%s' process model\n", binary_name, model));
status = server_service_startup(event_ctx, model, lp_server_services());
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Starting Services failed - %s\n", nt_errstr(status)));
@@ -260,5 +262,5 @@ static int binary_smbd_main(int argc, const char *argv[])
int main(int argc, const char *argv[])
{
- return binary_smbd_main(argc, argv);
+ return binary_smbd_main("smbd", argc, argv);
}