Re: [devel] [PATCH 1/1] dtm: updates to readme files and change of TRACE var in conf [#2776]
Hi Anders, I have incorporated your review comments and pushed the patch. Thank you Srinivas -Original Message- From: Anders Widell [mailto:anders.wid...@ericsson.com] Sent: Monday, February 12, 2018 6:26 PM To: srinivas Cc: opensaf-devel@lists.sourceforge.net Subject: Re: [PATCH 1/1] dtm: updates to readme files and change of TRACE var in conf [#2776] Ack with minor comments marked AndersW> below. regards, Anders Widell On 02/09/2018 12:36 PM, srinivas wrote: > --- > src/imm/README | 12 +++- > src/imm/immloadd/imm_loader.cc | 2 +- > src/imm/immnd/immnd.conf| 5 +++-- > src/imm/immpbed/immpbe.cc | 2 +- > src/imm/tools/imm_dumper.cc | 2 +- > src/ntf/README | 10 ++ > src/ntf/ntfd/ntfd.conf | 4 +++- > src/ntf/ntfimcnd/ntfimcn_main.c | 2 +- > 8 files changed, 23 insertions(+), 16 deletions(-) > > diff --git a/src/imm/README b/src/imm/README index d2f6b2f..ee5f8e8 > 100644 > --- a/src/imm/README > +++ b/src/imm/README > @@ -3194,7 +3194,9 @@ To enable/disable immd/immnd trace in a running system, > send signal USR2 to the > immd/immnd process. Each signal toggles the trace. > Trace default is disabled. > > -Traces are written to the file configured in immd.conf and immnd.conf > +Traces are written to the file configured in immd.conf and immnd.conf. > +Traces are always stored in $PKGLOGDIR directory and the directory > +component of the path name (if any) is ignored. > > To enable traces from the very start, uncomment: > > @@ -3204,21 +3206,21 @@ in immd.conf/immnd.conf and restart the cluster. > > Errors, warnings and notice level messages are logged to the syslog. > > -To enable traces in the IMM library, export the variable > IMMA_TRACE_PATHNAME > +To enable traces in the IMM library, export the variable > +IMMA_TRACE_FILENAME > with a valid pathname before starting the application using the IMM library. > > For example: > > -$ export IMMA_TRACE_PATHNAME=/tmp/imm.trace > +$ export IMMA_TRACE_FILENAME=imm.trace > $ ./immomtest > -$ cat /tmp/imm.trace > +$ cat $pkglogdir/imm.trace > > > It is also possible to trace slave processes forked by the IMMND. > This would be processes for loading, sync and dump/pbe. > To enable such trace uncomment: > > - #export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd > +#export IMMSV_TRACE_FILENAME=osafimmnd > > > TEST > diff --git a/src/imm/immloadd/imm_loader.cc > b/src/imm/immloadd/imm_loader.cc index 4b6ad08..bfd02a7 100644 > --- a/src/imm/immloadd/imm_loader.cc > +++ b/src/imm/immloadd/imm_loader.cc > @@ -2507,7 +2507,7 @@ int main(int argc, char *argv[]) { > exit(1); > } > > - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { > + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { > category_mask = 0x; /* TODO: set using env variable ? */ > } else { > logPath = defaultLog; AndersW> Also remove PKGLOGDIR "/" from this line in the code (not visible in the patch): const char *defaultLog = PKGLOGDIR "/osafimmnd"; > diff --git a/src/imm/immnd/immnd.conf b/src/imm/immnd/immnd.conf index > 97af792..9172677 100644 > --- a/src/imm/immnd/immnd.conf > +++ b/src/imm/immnd/immnd.conf > @@ -10,8 +10,9 @@ > # Uncomment the next line to enable trace for the imm-loader/sync > # and imm-pbe. When these are forked by the IMMND coordinator, > # they attach as IMMA clients. These processes will also route trace > to the -# IMMND trace-file as define here. > -#export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd > +# IMMND trace-file as define here. Traces are always stored in > +$PKGLOGDIR # directory and the directory component of the path name (if any) > is ignored. > +#export IMMSV_TRACE_FILENAME=osafimmnd > > # The directory where the imm.xml files and persistend backend files are > # stored. Imm dump files may also be stored here or in a subdirectory. > diff --git a/src/imm/immpbed/immpbe.cc b/src/imm/immpbed/immpbe.cc > index 964086f..6e9b933 100644 > --- a/src/imm/immpbed/immpbe.cc > +++ b/src/imm/immpbed/immpbe.cc > @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) { > const SaImmAdminOperationParamsT_2* params[] = {NULL}; > SaImmAdminOperationParamsT_2** retParams = NULL; > > - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { > + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { > category_mask = 0x; /* TODO: set using -t flag ? */ > } else { > logPath = defaultLog; > diff --git a/src/imm/tools/imm_dumper.cc b/src/imm/tools/imm_dumper.cc > index 0365fc7..5e5dd00 100644 > --- a/src/imm/tools/imm_dumper.cc > +++ b/src/imm/tools/imm_dumper.cc > @@ -123,7 +123,7 @@ int main(int argc, char* argv[]) { > * osaf_extended_name_* before saImmOmInitialize and saImmOiInitialize */ > osaf_extended_name_init(); > > - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { > + if ((logPath = getenv("IMMSV_TRACE_FI
Re: [devel] [PATCH 1/1] dtm: updates to readme files and change of TRACE var in conf [#2776]
Ack with minor comments marked AndersW> below. regards, Anders Widell On 02/09/2018 12:36 PM, srinivas wrote: --- src/imm/README | 12 +++- src/imm/immloadd/imm_loader.cc | 2 +- src/imm/immnd/immnd.conf| 5 +++-- src/imm/immpbed/immpbe.cc | 2 +- src/imm/tools/imm_dumper.cc | 2 +- src/ntf/README | 10 ++ src/ntf/ntfd/ntfd.conf | 4 +++- src/ntf/ntfimcnd/ntfimcn_main.c | 2 +- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/imm/README b/src/imm/README index d2f6b2f..ee5f8e8 100644 --- a/src/imm/README +++ b/src/imm/README @@ -3194,7 +3194,9 @@ To enable/disable immd/immnd trace in a running system, send signal USR2 to the immd/immnd process. Each signal toggles the trace. Trace default is disabled. -Traces are written to the file configured in immd.conf and immnd.conf +Traces are written to the file configured in immd.conf and immnd.conf. +Traces are always stored in $PKGLOGDIR directory and the directory component +of the path name (if any) is ignored. To enable traces from the very start, uncomment: @@ -3204,21 +3206,21 @@ in immd.conf/immnd.conf and restart the cluster. Errors, warnings and notice level messages are logged to the syslog. -To enable traces in the IMM library, export the variable IMMA_TRACE_PATHNAME +To enable traces in the IMM library, export the variable IMMA_TRACE_FILENAME with a valid pathname before starting the application using the IMM library. For example: -$ export IMMA_TRACE_PATHNAME=/tmp/imm.trace +$ export IMMA_TRACE_FILENAME=imm.trace $ ./immomtest -$ cat /tmp/imm.trace +$ cat $pkglogdir/imm.trace It is also possible to trace slave processes forked by the IMMND. This would be processes for loading, sync and dump/pbe. To enable such trace uncomment: - #export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd +#export IMMSV_TRACE_FILENAME=osafimmnd TEST diff --git a/src/imm/immloadd/imm_loader.cc b/src/imm/immloadd/imm_loader.cc index 4b6ad08..bfd02a7 100644 --- a/src/imm/immloadd/imm_loader.cc +++ b/src/imm/immloadd/imm_loader.cc @@ -2507,7 +2507,7 @@ int main(int argc, char *argv[]) { exit(1); } - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { category_mask = 0x; /* TODO: set using env variable ? */ } else { logPath = defaultLog; AndersW> Also remove PKGLOGDIR "/" from this line in the code (not visible in the patch): const char *defaultLog = PKGLOGDIR "/osafimmnd"; diff --git a/src/imm/immnd/immnd.conf b/src/imm/immnd/immnd.conf index 97af792..9172677 100644 --- a/src/imm/immnd/immnd.conf +++ b/src/imm/immnd/immnd.conf @@ -10,8 +10,9 @@ # Uncomment the next line to enable trace for the imm-loader/sync # and imm-pbe. When these are forked by the IMMND coordinator, # they attach as IMMA clients. These processes will also route trace to the -# IMMND trace-file as define here. -#export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd +# IMMND trace-file as define here. Traces are always stored in $PKGLOGDIR +# directory and the directory component of the path name (if any) is ignored. +#export IMMSV_TRACE_FILENAME=osafimmnd # The directory where the imm.xml files and persistend backend files are # stored. Imm dump files may also be stored here or in a subdirectory. diff --git a/src/imm/immpbed/immpbe.cc b/src/imm/immpbed/immpbe.cc index 964086f..6e9b933 100644 --- a/src/imm/immpbed/immpbe.cc +++ b/src/imm/immpbed/immpbe.cc @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) { const SaImmAdminOperationParamsT_2* params[] = {NULL}; SaImmAdminOperationParamsT_2** retParams = NULL; - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { category_mask = 0x; /* TODO: set using -t flag ? */ } else { logPath = defaultLog; diff --git a/src/imm/tools/imm_dumper.cc b/src/imm/tools/imm_dumper.cc index 0365fc7..5e5dd00 100644 --- a/src/imm/tools/imm_dumper.cc +++ b/src/imm/tools/imm_dumper.cc @@ -123,7 +123,7 @@ int main(int argc, char* argv[]) { * osaf_extended_name_* before saImmOmInitialize and saImmOiInitialize */ osaf_extended_name_init(); - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { category_mask = 0x; /* TODO: set using -t flag ? */ } else { logPath = defaultLog; diff --git a/src/ntf/README b/src/ntf/README index b684d66..938766e 100644 --- a/src/ntf/README +++ b/src/ntf/README @@ -260,14 +260,16 @@ in ntfd.conf (see CONFIGURATION above) and restart the cluster. For fatal errors syslog is used. -To enable traces in the NTF library, export the variable NTFSV_TRACE_PATHNAME -with a valid pathname before starting the application using the NTF library. +To enable traces in the NTF library, export the variable NTFS
[devel] [PATCH 1/1] dtm: updates to readme files and change of TRACE var in conf [#2776]
--- src/imm/README | 12 +++- src/imm/immloadd/imm_loader.cc | 2 +- src/imm/immnd/immnd.conf| 5 +++-- src/imm/immpbed/immpbe.cc | 2 +- src/imm/tools/imm_dumper.cc | 2 +- src/ntf/README | 10 ++ src/ntf/ntfd/ntfd.conf | 4 +++- src/ntf/ntfimcnd/ntfimcn_main.c | 2 +- 8 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/imm/README b/src/imm/README index d2f6b2f..ee5f8e8 100644 --- a/src/imm/README +++ b/src/imm/README @@ -3194,7 +3194,9 @@ To enable/disable immd/immnd trace in a running system, send signal USR2 to the immd/immnd process. Each signal toggles the trace. Trace default is disabled. -Traces are written to the file configured in immd.conf and immnd.conf +Traces are written to the file configured in immd.conf and immnd.conf. +Traces are always stored in $PKGLOGDIR directory and the directory component +of the path name (if any) is ignored. To enable traces from the very start, uncomment: @@ -3204,21 +3206,21 @@ in immd.conf/immnd.conf and restart the cluster. Errors, warnings and notice level messages are logged to the syslog. -To enable traces in the IMM library, export the variable IMMA_TRACE_PATHNAME +To enable traces in the IMM library, export the variable IMMA_TRACE_FILENAME with a valid pathname before starting the application using the IMM library. For example: -$ export IMMA_TRACE_PATHNAME=/tmp/imm.trace +$ export IMMA_TRACE_FILENAME=imm.trace $ ./immomtest -$ cat /tmp/imm.trace +$ cat $pkglogdir/imm.trace It is also possible to trace slave processes forked by the IMMND. This would be processes for loading, sync and dump/pbe. To enable such trace uncomment: - #export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd +#export IMMSV_TRACE_FILENAME=osafimmnd TEST diff --git a/src/imm/immloadd/imm_loader.cc b/src/imm/immloadd/imm_loader.cc index 4b6ad08..bfd02a7 100644 --- a/src/imm/immloadd/imm_loader.cc +++ b/src/imm/immloadd/imm_loader.cc @@ -2507,7 +2507,7 @@ int main(int argc, char *argv[]) { exit(1); } - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { category_mask = 0x; /* TODO: set using env variable ? */ } else { logPath = defaultLog; diff --git a/src/imm/immnd/immnd.conf b/src/imm/immnd/immnd.conf index 97af792..9172677 100644 --- a/src/imm/immnd/immnd.conf +++ b/src/imm/immnd/immnd.conf @@ -10,8 +10,9 @@ # Uncomment the next line to enable trace for the imm-loader/sync # and imm-pbe. When these are forked by the IMMND coordinator, # they attach as IMMA clients. These processes will also route trace to the -# IMMND trace-file as define here. -#export IMMSV_TRACE_PATHNAME=$pkglogdir/osafimmnd +# IMMND trace-file as define here. Traces are always stored in $PKGLOGDIR +# directory and the directory component of the path name (if any) is ignored. +#export IMMSV_TRACE_FILENAME=osafimmnd # The directory where the imm.xml files and persistend backend files are # stored. Imm dump files may also be stored here or in a subdirectory. diff --git a/src/imm/immpbed/immpbe.cc b/src/imm/immpbed/immpbe.cc index 964086f..6e9b933 100644 --- a/src/imm/immpbed/immpbe.cc +++ b/src/imm/immpbed/immpbe.cc @@ -118,7 +118,7 @@ int main(int argc, char* argv[]) { const SaImmAdminOperationParamsT_2* params[] = {NULL}; SaImmAdminOperationParamsT_2** retParams = NULL; - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { category_mask = 0x; /* TODO: set using -t flag ? */ } else { logPath = defaultLog; diff --git a/src/imm/tools/imm_dumper.cc b/src/imm/tools/imm_dumper.cc index 0365fc7..5e5dd00 100644 --- a/src/imm/tools/imm_dumper.cc +++ b/src/imm/tools/imm_dumper.cc @@ -123,7 +123,7 @@ int main(int argc, char* argv[]) { * osaf_extended_name_* before saImmOmInitialize and saImmOiInitialize */ osaf_extended_name_init(); - if ((logPath = getenv("IMMSV_TRACE_PATHNAME"))) { + if ((logPath = getenv("IMMSV_TRACE_FILENAME"))) { category_mask = 0x; /* TODO: set using -t flag ? */ } else { logPath = defaultLog; diff --git a/src/ntf/README b/src/ntf/README index b684d66..938766e 100644 --- a/src/ntf/README +++ b/src/ntf/README @@ -260,14 +260,16 @@ in ntfd.conf (see CONFIGURATION above) and restart the cluster. For fatal errors syslog is used. -To enable traces in the NTF library, export the variable NTFSV_TRACE_PATHNAME -with a valid pathname before starting the application using the NTF library. +To enable traces in the NTF library, export the variable NTFSV_TRACE_FILENAME +with a valid filename before starting the application using the NTF library. +Traces are always stored in $PKGLOGDIR directory and the directory component +of the path name (if any) is ignored. For example: -$ export NTFSV_TRACE_PATHNAME=/tmp/ntf.trace +$ export NTFSV_TRACE_FILENAME=ntf.trace $ ntfsend