From: Dave H. <hel...@us...> - 2013-11-27 16:11:52
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "sfcb - Small Footprint CIM Broker". The branch, master has been updated via 3656589ab63831a8f09a838a310322bfebe9cb13 (commit) from bde75719684c814f23e374ec16459db2333b4e98 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 3656589ab63831a8f09a838a310322bfebe9cb13 Author: Dave Heller <hel...@us...> Date: Wed Nov 27 11:10:19 2013 -0500 [sfcb-tix:#76] Use SFCB_LABELPROCS env var instead of labelProcs config ----------------------------------------------------------------------- Summary of changes: control.c | 1 - man/sfcbd.1.pre.in | 9 +++++++++ sfcBroker.c | 19 +++++++++++++++---- sfcb.cfg.pre.in | 11 +---------- 4 files changed, 25 insertions(+), 15 deletions(-) diff --git a/control.c b/control.c index 0566dfd..1f789ff 100644 --- a/control.c +++ b/control.c @@ -124,7 +124,6 @@ void restoreOrigArgv(int removePad) { /* Control initial values { property, type, string value, numeric value} */ static Control init[] = { - {"labelProcs", CTL_UINT, NULL, {.uint=0}}, {"ip4AddrList", CTL_STRING, NULL, {0}}, {"ip6AddrList", CTL_STRING, NULL, {0}}, {"httpPort", CTL_LONG, NULL, {.slong=5988}}, diff --git a/man/sfcbd.1.pre.in b/man/sfcbd.1.pre.in index b9833f8..884a361 100644 --- a/man/sfcbd.1.pre.in +++ b/man/sfcbd.1.pre.in @@ -248,6 +248,15 @@ platforms to be generated by sfcb in special situations. .br [Note: not currently ever used] .TP +.B SFCB_LABELPROCS +If set to a positive integer value, enable the process labeling feature. +This adds a description of each process' role to the process cmdline +so that it appears in 'ps' output. The identifying info will be appended +to the original arv data, following any passed arguments. The number of bytes +appended is limited by the value of SFCB_LABELPROCS. A value of about 100 +should be enough in most cases. A smaller value may truncate the data, but +this may be desired. To disable, set the vaue to zero, or unset the env var. +.TP .B SBLIM_TRACE Specifies the level of trace/debug messages for SBLIM providers. Valid values are 0 (no trace messages), or 1 (key trace messages only) diff --git a/sfcBroker.c b/sfcBroker.c index 0f4ed46..5063415 100644 --- a/sfcBroker.c +++ b/sfcBroker.c @@ -655,6 +655,12 @@ main(int argc, char *argv[]) char *pauseStr; int daemonize=0; + /* Note we will see no mlogf() output prior to this flag being set. If the + * flag is set but startLogging() has not yet been called, mlogf() will write + * to syslog directly. After startLogging(), mlogf() will write through the + * the logging facility. */ + sfcbUseSyslog=1; + name = strrchr(argv[0], '/'); if (name != NULL) ++name; @@ -782,8 +788,15 @@ main(int argc, char *argv[]) currentProc=sfcBrokerPid=getpid(); /* req. on some systems */ } - setupControl(configfile); /* enable reading the config file */ - if ((getControlUNum("labelProcs", &labelProcs) == 0) && (labelProcs > 0)) { + char *envLabelProcs = getenv("SFCB_LABELPROCS"); + if (envLabelProcs && *envLabelProcs) { + char *endptr; + long val = strtol(envLabelProcs, &endptr, 10); + if ((*endptr =='\0') && (val > 0) && (val < 1024)) + labelProcs = (unsigned int) val; + } + + if (labelProcs) { if (*argv[argc-1] != 'X') { /* Create an expanded argv */ char **newArgv = malloc(sizeof(char*) * (argc + 2)); @@ -809,9 +822,7 @@ main(int argc, char *argv[]) exit(1); } } - sunsetControl(); /* ensures setupControl() is re-run after startLogging() */ - sfcbUseSyslog=1; startLogging(syslogLevel,1); mlogf(M_NOTICE, M_SHOW, "--- %s V" sfcHttpDaemonVersion " started - %d\n", diff --git a/sfcb.cfg.pre.in b/sfcb.cfg.pre.in index 41dbfb5..d575a7e 100644 --- a/sfcb.cfg.pre.in +++ b/sfcb.cfg.pre.in @@ -313,7 +313,7 @@ sslCiphers: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH #slpRefreshInterval: 600 -##------------------------------- Trace and Debug ----------------------------- +##------------------------------------ Trace ---------------------------------- ## Location of the trace file. ## Can be overriden by setting environment variable SFCB_TRACE_FILE @@ -331,15 +331,6 @@ sslCiphers: ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH ## Default is 0. If trace mask is set (by any method) the default is 1. #traceLevel: 0 -## Label each process by adding identifying information to the process cmdline -## so that it appears in 'ps' output. The identifying info will be appended to -## the original argv data, following any passed arguments. The number of bytes -## appended is limited by the value of labelProcs. A value of about 100 should -## be enough in most cases. A smaller value may truncate the data, but this may -## be desired. A value of 0 means the feature is disabled. -## Default is 0 -#labelProcs: 100 - ##---------------------------- Indications ---------------------------- ## Indication provider calls to CBDeliverIndication() cause a thread to spawn hooks/post-receive -- sfcb - Small Footprint CIM Broker |