Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-19 Thread Mathivanan Naickan Palanivelu
Hi HansN,

Good that you are sending this. 
Some additional info to think about:

1) There is already an existing configure option --with_rpm_release
And a AC_SUBSTed variable OPENSAF_RPM_RELEASE.
You may think of using this...

2) If the above variable does not sound interesting to you then now that you 
have given this patch,
You could print this changeset info during opensaf startup also.
For eg:-
Like this
diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
b/osaf/services/infrastructure/nid/scripts/opensafd.in
--- a/osaf/services/infrastructure/nid/scripts/opensafd.in
+++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
@@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
osafversion=@OPENSAF_RELEASE@
 fi

+osafcshash=@INTERNAL_VERSION_ID@
+
 unload_tipc() {

# Unload TIPC if already loaded
@@ -215,7 +217,7 @@ start() {
start_daemon $binary $args
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
-   logger -t $prog "OpenSAF($osafversion) services successfully 
started"
+   logger -t $prog "OpenSAF($osafversion - $osafcshash) services 
successfully started"
touch $lockfile
log_success_msg
else

3) Sometime back, I was comparing the output of the following command variants:
$ hg id -i
versus
$ hg parent --template

There is some caveat around one of this, I forgot which command works
best when working on multiple branches.

Ack, if you already investigated this, but you may want to think of atleast 
comment (2) above.

Thanks,
Mathi.

> -Original Message-
> From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
> Sent: Thursday, December 19, 2013 1:52 PM
> To: anders.wid...@ericsson.com; Mathivanan Naickan Palanivelu
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] osaf: Improve fault analyse by using current
> changeset when configuring osaf [#676]
> 
>  Makefile.common |  4 ++--
>  configure.ac|  2 ++
>  osaf/services/saf/amf/amfd/main.cc  |  4 
> osaf/services/saf/amf/amfnd/main.cc |  4 
>  4 files changed, 12 insertions(+), 2 deletions(-)
> 
> 
> Current changeset can be generated and visible in the syslog and in the file 
> in
> question to improve fault analyse.
> 
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
> 
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
> @OSAF_HARDEN_FLAGS@ -AM_CXXFLAGS = -Wall -fno-strict-aliasing -
> Werror -fPIC -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
> @OSAF_HARDEN_FLAGS@ -
> DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -
> D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ -
> DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
>  AM_LDFLAGS = -ldl -lrt -lpthread
> 
>  #
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
>  OPENSAF_LIB_VERSION=0:0:0
>  AC_SUBST([OPENSAF_LIB_VERSION])
> 
> +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template
> +"{rev}:{node|short}") ])
> +
>  # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not
> executable  AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" =
> "yes")
>  #m4_include([m4/linker-script.m4])
> diff --git a/osaf/services/saf/amf/amfd/main.cc
> b/osaf/services/saf/amf/amfd/main.cc
> --- a/osaf/services/saf/amf/amfd/main.cc
> +++ b/osaf/services/saf/amf/amfd/main.cc
> @@ -63,6 +63,8 @@ enum {
>   FD_IMM // must be last
>  };
> 
> +static const char* internal_version_id_ = INTERNAL_VERSION_ID;
> +
>  // Singleton Control Block. Statically allocated  static AVD_CL_CB
> _control_block;
> 
> @@ -627,6 +629,8 @@ static void main_loop(void)
>  // will unwind the stack and thus no call chain will be available.
>  std::set_new_handler(new_handler);
> 
> + syslog(LOG_NOTICE, "Internal version id: %s", internal_version_id_);
> +
>   mbx_fd = ncs_ipc_get_sel_obj(&cb->avd_mbx);
>   daemon_sigterm_install(&term_fd);
> 
> diff --git a/osaf/services/saf/amf/amfnd/main.cc
> b/osaf/services/saf/amf/amfnd/main.cc
> --- a/osaf/services/saf/amf/amfnd/main.cc
> +++ b/osaf/services/saf/amf/amfnd/main.cc
> @@ -37,6 +37,8 @@
>  #define FD_CLM   2
>  #define FD_MBCSV 3
> 
> +static const char* internal_version_id_ = INTERNAL_VERSION_ID;
> +
>  static NCS_SEL_OBJ term_sel_obj; /* Selection object for TERM signal
> events */
> 
>  static void avnd_evt_process(AVND_EVT *); @@ -551,6 +553,8 @@ void
> avnd_main_process(void)
> 
>   TRACE_ENTER();
> 
> + syslog(LOG_NOTICE, "Internal version id: %s", internal_version_id_);
> +
>   if (avnd_create() != NCSCC_RC_SUCCESS) {
>   LOG_ER("avnd_create failed");
>   goto done;


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-19 Thread Hans Nordebäck
Hi Mathi, thanks for the quick feedback. Yes I can add point 2 below, and when 
the patch is pushed each service should add the 
INTERNAL_VERSION_ID like amfd and amfnd in the patch. When analysing core dumps 
 it is good to know the changeset ./BR HansN

-Original Message-
From: Mathivanan Naickan Palanivelu [mailto:mathi.naic...@oracle.com] 
Sent: den 19 december 2013 10:14
To: Hans Nordebäck; Anders Widell
Cc: opensaf-devel@lists.sourceforge.net
Subject: RE: [PATCH 1 of 1] osaf: Improve fault analyse by using current 
changeset when configuring osaf [#676]

Hi HansN,

Good that you are sending this. 
Some additional info to think about:

1) There is already an existing configure option --with_rpm_release And a 
AC_SUBSTed variable OPENSAF_RPM_RELEASE.
You may think of using this...

2) If the above variable does not sound interesting to you then now that you 
have given this patch, You could print this changeset info during opensaf 
startup also.
For eg:-
Like this
diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
b/osaf/services/infrastructure/nid/scripts/opensafd.in
--- a/osaf/services/infrastructure/nid/scripts/opensafd.in
+++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
@@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
osafversion=@OPENSAF_RELEASE@
 fi

+osafcshash=@INTERNAL_VERSION_ID@
+
 unload_tipc() {

# Unload TIPC if already loaded
@@ -215,7 +217,7 @@ start() {
start_daemon $binary $args
RETVAL=$?
if [ $RETVAL -eq 0 ]; then
-   logger -t $prog "OpenSAF($osafversion) services successfully 
started"
+   logger -t $prog "OpenSAF($osafversion - $osafcshash) services 
successfully started"
touch $lockfile
log_success_msg
else

3) Sometime back, I was comparing the output of the following command variants:
$ hg id -i
versus
$ hg parent --template

There is some caveat around one of this, I forgot which command works best when 
working on multiple branches.

Ack, if you already investigated this, but you may want to think of atleast 
comment (2) above.

Thanks,
Mathi.

> -Original Message-
> From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
> Sent: Thursday, December 19, 2013 1:52 PM
> To: anders.wid...@ericsson.com; Mathivanan Naickan Palanivelu
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] osaf: Improve fault analyse by using current 
> changeset when configuring osaf [#676]
> 
>  Makefile.common |  4 ++--
>  configure.ac|  2 ++
>  osaf/services/saf/amf/amfd/main.cc  |  4  
> osaf/services/saf/amf/amfnd/main.cc |  4 
>  4 files changed, 12 insertions(+), 2 deletions(-)
> 
> 
> Current changeset can be generated and visible in the syslog and in 
> the file in question to improve fault analyse.
> 
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
> 
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> @OSAF_HARDEN_FLAGS@ -AM_CXXFLAGS = -Wall -fno-strict-aliasing - Werror 
> -fPIC -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
> @OSAF_HARDEN_FLAGS@ -
> DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -
> D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ - 
> DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
>  AM_LDFLAGS = -ldl -lrt -lpthread
> 
>  #
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
>  OPENSAF_LIB_VERSION=0:0:0
>  AC_SUBST([OPENSAF_LIB_VERSION])
> 
> +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template
> +"{rev}:{node|short}") ])
> +
>  # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
> executable  AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" =
> "yes")
>  #m4_include([m4/linker-script.m4])
> diff --git a/osaf/services/saf/amf/amfd/main.cc
> b/osaf/services/saf/amf/amfd/main.cc
> --- a/osaf/services/saf/amf/amfd/main.cc
> +++ b/osaf/services/saf/amf/amfd/main.cc
> @@ -63,6 +63,8 @@ enum {
>   FD_IMM // must be last
>  };
> 
> +static const char* internal_version_id_ = INTERNAL_VERSION_ID;
> +
>  // Singleton Control Block. Statically allocated  static AVD_CL_CB 
> _control_block;
> 
> @@ -627,6 +629,8 @@ static void main_loop(void)
>  // will unwind the stack and thus no call chain will be available.
>  std::set_new_handler(new_handler);
> 
> + syslog(LOG_NOTICE, "Internal version id: %s", internal_version_id_);
> +
>   mbx_fd = ncs_ipc_get_sel_obj(&cb->avd_mbx);
>   daemon_sigterm_install(&term_fd);
> 
> diff --git a/osaf/services/saf/amf/amfnd/main.cc
> b/osaf/services/saf/amf/amfnd/main.cc
> --- a/osaf/services/saf/amf/amfnd/main.cc
> +++ b/osaf/services/saf/amf/amfnd/main.cc
> @@ -

Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-19 Thread Mathivanan Naickan Palanivelu
But, you should also take care of the case when this value is empty(does not 
get set for whatever reason).
- Mathi.

> -Original Message-
> From: Hans Nordebäck [mailto:hans.nordeb...@ericsson.com]
> Sent: Thursday, December 19, 2013 3:28 PM
> To: Mathivanan Naickan Palanivelu; Anders Widell
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: RE: [PATCH 1 of 1] osaf: Improve fault analyse by using current
> changeset when configuring osaf [#676]
> 
> Hi Mathi, thanks for the quick feedback. Yes I can add point 2 below, and
> when the patch is pushed each service should add the
> INTERNAL_VERSION_ID like amfd and amfnd in the patch. When analysing
> core dumps  it is good to know the changeset ./BR HansN
> 
> -Original Message-
> From: Mathivanan Naickan Palanivelu [mailto:mathi.naic...@oracle.com]
> Sent: den 19 december 2013 10:14
> To: Hans Nordebäck; Anders Widell
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: RE: [PATCH 1 of 1] osaf: Improve fault analyse by using current
> changeset when configuring osaf [#676]
> 
> Hi HansN,
> 
> Good that you are sending this.
> Some additional info to think about:
> 
> 1) There is already an existing configure option --with_rpm_release And a
> AC_SUBSTed variable OPENSAF_RPM_RELEASE.
> You may think of using this...
> 
> 2) If the above variable does not sound interesting to you then now that you
> have given this patch, You could print this changeset info during opensaf
> startup also.
> For eg:-
> Like this
> diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in
> b/osaf/services/infrastructure/nid/scripts/opensafd.in
> --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
> +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
> @@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
> osafversion=@OPENSAF_RELEASE@
>  fi
> 
> +osafcshash=@INTERNAL_VERSION_ID@
> +
>  unload_tipc() {
> 
> # Unload TIPC if already loaded
> @@ -215,7 +217,7 @@ start() {
> start_daemon $binary $args
> RETVAL=$?
> if [ $RETVAL -eq 0 ]; then
> -   logger -t $prog "OpenSAF($osafversion) services successfully
> started"
> +   logger -t $prog "OpenSAF($osafversion - $osafcshash) services
> successfully started"
> touch $lockfile
> log_success_msg
> else
> 
> 3) Sometime back, I was comparing the output of the following command
> variants:
> $ hg id -i
> versus
> $ hg parent --template
> 
> There is some caveat around one of this, I forgot which command works best
> when working on multiple branches.
> 
> Ack, if you already investigated this, but you may want to think of atleast
> comment (2) above.
> 
> Thanks,
> Mathi.
> 
> > -Original Message-
> > From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
> > Sent: Thursday, December 19, 2013 1:52 PM
> > To: anders.wid...@ericsson.com; Mathivanan Naickan Palanivelu
> > Cc: opensaf-devel@lists.sourceforge.net
> > Subject: [PATCH 1 of 1] osaf: Improve fault analyse by using current
> > changeset when configuring osaf [#676]
> >
> >  Makefile.common |  4 ++--
> >  configure.ac|  2 ++
> >  osaf/services/saf/amf/amfd/main.cc  |  4 
> > osaf/services/saf/amf/amfnd/main.cc |  4 
> >  4 files changed, 12 insertions(+), 2 deletions(-)
> >
> >
> > Current changeset can be generated and visible in the syslog and in
> > the file in question to improve fault analyse.
> >
> > diff --git a/Makefile.common b/Makefile.common
> > --- a/Makefile.common
> > +++ b/Makefile.common
> > @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
> > $(CORE_INCLUDES) \
> > $(all_includes)
> >
> > -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
> > @OSAF_HARDEN_FLAGS@ -AM_CXXFLAGS = -Wall -fno-strict-aliasing -
> Werror
> > -fPIC -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> > +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
> > @OSAF_HARDEN_FLAGS@ -
> > DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
> > +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -
> > D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ -
> > DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
> >  AM_LDFLAGS = -ldl -lrt -lpthread
> >
> >  #
> > diff --git a/configure.ac b/configure.ac
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
> >  OPENSAF_LIB_VERSION=0:0:0
> >  AC_SUBST([OPENSAF_LIB_VERSION])
> >
> > +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template
> > +"{rev}:{node|short}") ])
> > +
> >  # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not
> > executable  AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" =
> > "yes")
> >  #m4_include([m4/linker-script.m4])
> > diff --git a/osaf/services/saf/amf/amfd/main.cc
> > b/osaf/services/saf/amf/amfd/main.cc
> > --- a/osaf/services/saf/amf/amfd/main.cc
> > +++ b/osaf/services/saf/amf/amfd/main.cc
> > @@ -63,6 +63,8 @@ enum {
> > FD_IMM // must be last
> >  };
> >
> > +static const ch

Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-19 Thread Anders Widell
Hi!

Some comments:

It seems that if you put it as a static const char* xyz = "ABC", then 
the string will be a read-only string that is only present in the 
executable and doesn't get copied into the core dump. To make sure the 
string ends up in the core dump, you could allocate it dynamically by 
doing something like this:

 static const char* internal_version_id_;



 internal_version_id_ = strdup("@(#) $Id: " INTERNAL_VERSION_ID 
" $");
 syslog(LOG_NOTICE, "Internal version id: %s", INTERNAL_VERSION_ID);

Also, in the code above I have added "@(#) $Id: " as a prefix, so that 
the id string can be identified by running the "ident" or "what" command 
on the core dump.

This feature is not specific to AMF, so the strdup() command should not 
be run in AMFD, but rather in some library function that is executed by 
all services.

Also, the modifications to Makefile.common look a bit strange. It seems 
to work, but I find it more natural to do it this way:

AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
-DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'

regards,
Anders Widell

2013-12-19 09:22, Hans Nordeback skrev:
>   Makefile.common |  4 ++--
>   configure.ac|  2 ++
>   osaf/services/saf/amf/amfd/main.cc  |  4 
>   osaf/services/saf/amf/amfnd/main.cc |  4 
>   4 files changed, 12 insertions(+), 2 deletions(-)
>
>
> Current changeset can be generated and visible in the syslog and in the
> file in question to improve fault analyse.
>
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
>   
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
> -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"$(INTERNAL_VERSION_ID)"'
>   AM_LDFLAGS = -ldl -lrt -lpthread
>   
>   #
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
>   OPENSAF_LIB_VERSION=0:0:0
>   AC_SUBST([OPENSAF_LIB_VERSION])
>   
> +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template "{rev}:{node|short}") 
> ])
> +
>   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
> executable
>   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" = "yes")
>   #m4_include([m4/linker-script.m4])
> diff --git a/osaf/services/saf/amf/amfd/main.cc 
> b/osaf/services/saf/amf/amfd/main.cc
> --- a/osaf/services/saf/amf/amfd/main.cc
> +++ b/osaf/services/saf/amf/amfd/main.cc
> @@ -63,6 +63,8 @@ enum {
>   FD_IMM // must be last
>   };
>   
> +static const char* internal_version_id_ = INTERNAL_VERSION_ID;
> +
>   // Singleton Control Block. Statically allocated
>   static AVD_CL_CB _control_block;
>   
> @@ -627,6 +629,8 @@ static void main_loop(void)
>   // will unwind the stack and thus no call chain will be available.
>   std::set_new_handler(new_handler);
>   
> + syslog(LOG_NOTICE, "Internal version id: %s", internal_version_id_);
> + 
>   mbx_fd = ncs_ipc_get_sel_obj(&cb->avd_mbx);
>   daemon_sigterm_install(&term_fd);
>   
> diff --git a/osaf/services/saf/amf/amfnd/main.cc 
> b/osaf/services/saf/amf/amfnd/main.cc
> --- a/osaf/services/saf/amf/amfnd/main.cc
> +++ b/osaf/services/saf/amf/amfnd/main.cc
> @@ -37,6 +37,8 @@
>   #define FD_CLM   2
>   #define FD_MBCSV 3
>   
> +static const char* internal_version_id_ = INTERNAL_VERSION_ID;
> +
>   static NCS_SEL_OBJ term_sel_obj; /* Selection object for TERM signal events 
> */
>   
>   static void avnd_evt_process(AVND_EVT *);
> @@ -551,6 +553,8 @@ void avnd_main_process(void)
>   
>   TRACE_ENTER();
>   
> + syslog(LOG_NOTICE, "Internal version id: %s", internal_version_id_);
> +
>   if (avnd_create() != NCSCC_RC_SUCCESS) {
>   LOG_ER("avnd_create failed");
>   goto done;


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-20 Thread Anders Widell
Looks quite good now, but I still have one more comment :-)

This solution doesn't work so good together with "make dist" to create a 
release. The resulting tarball does not contain a mercurial repository, 
so the "hg" command fails. Not sure how to solve this. One way would be 
to ignore it - then a release would not contain any mercurial changeset 
ID. Still it is a bit unfortunate to run the "hg" command when there is 
no repo. Also, if the version is set to something like "4.4.M0" then we 
have no clue what changeset it is.

Another way could be to run the "hg" command either as part of "make 
dist", or by postprocessing the configure script in the bootstrap.sh 
script. I.e. adding a "sed" command as the last thing in bootstrap.sh

regards,
Anders Widell

2013-12-19 16:39, Hans Nordeback skrev:
>   Makefile.common  |  4 ++--
>   configure.ac |  2 ++
>   osaf/libs/core/common/daemon.c   |  4 
>   osaf/services/infrastructure/nid/scripts/opensafd.in |  4 +++-
>   4 files changed, 11 insertions(+), 3 deletions(-)
>
>
> Current changeset can be generated and visible in the syslog and in the
> file in question to improve fault analyse. Updated wih review comments.
>
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
>   
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
> -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
>   AM_LDFLAGS = -ldl -lrt -lpthread
>   
>   #
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
>   OPENSAF_LIB_VERSION=0:0:0
>   AC_SUBST([OPENSAF_LIB_VERSION])
>   
> +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template "{rev}:{node|short}") 
> ])
> +
>   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
> executable
>   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" = "yes")
>   #m4_include([m4/linker-script.m4])
> diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
> --- a/osaf/libs/core/common/daemon.c
> +++ b/osaf/libs/core/common/daemon.c
> @@ -43,6 +43,8 @@
>   
>   #define DEFAULT_RUNAS_USERNAME  "opensaf"
>   
> +static const char* internal_version_id_;
> +
>   extern  void __gcov_flush(void) __attribute__((weak));
>   
>   static char __pidfile[NAME_MAX];
> @@ -206,6 +208,8 @@ void daemonize(int argc, char *argv[])
>   char buf1[256] = { 0 };
>   char buf2[256] = { 0 };
>   
> + internal_version_id_ = strdup("@(#) $Id: " INTERNAL_VERSION_ID " $");
> + 
>   if (argc > 0 && argv != NULL) { 
>   __parse_options(argc, argv);
>   openlog(basename(argv[0]), LOG_PID, LOG_LOCAL0);
> diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
> b/osaf/services/infrastructure/nid/scripts/opensafd.in
> --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
> +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
> @@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
>  osafversion=@OPENSAF_RELEASE@
>   fi
>   
> +osafcshash=@INTERNAL_VERSION_ID@
> +
>   unload_tipc() {
>   
>   # Unload TIPC if already loaded
> @@ -215,7 +217,7 @@ start() {
>   start_daemon $binary $args
>   RETVAL=$?
>   if [ $RETVAL -eq 0 ]; then
> - logger -t $prog "OpenSAF($osafversion) services successfully 
> started"
> + logger -t $prog "OpenSAF($osafversion - $osafcshash) services 
> successfully started"
>   touch $lockfile
>   log_success_msg
>   else


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-20 Thread Anders Widell
I think something like this could do the trick:

In configure.ac:

INTERNAL_VERSION_ID=0:
AC_SUBST([INTERNAL_VERSION_ID])

In bootstrap.sh:

autoreconf -vi
sed -i "s/^INTERNAL_VERSION_ID=.*\$/INTERNAL_VERSION_ID=$(hg parent 
--template "{rev}:{node|short}")/" configure

regards,
Anders Widell

2013-12-19 16:39, Hans Nordeback skrev:
>   Makefile.common  |  4 ++--
>   configure.ac |  2 ++
>   osaf/libs/core/common/daemon.c   |  4 
>   osaf/services/infrastructure/nid/scripts/opensafd.in |  4 +++-
>   4 files changed, 11 insertions(+), 3 deletions(-)
>
>
> Current changeset can be generated and visible in the syslog and in the
> file in question to improve fault analyse. Updated wih review comments.
>
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
>   
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
> -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
>   AM_LDFLAGS = -ldl -lrt -lpthread
>   
>   #
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
>   OPENSAF_LIB_VERSION=0:0:0
>   AC_SUBST([OPENSAF_LIB_VERSION])
>   
> +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template "{rev}:{node|short}") 
> ])
> +
>   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
> executable
>   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" = "yes")
>   #m4_include([m4/linker-script.m4])
> diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
> --- a/osaf/libs/core/common/daemon.c
> +++ b/osaf/libs/core/common/daemon.c
> @@ -43,6 +43,8 @@
>   
>   #define DEFAULT_RUNAS_USERNAME  "opensaf"
>   
> +static const char* internal_version_id_;
> +
>   extern  void __gcov_flush(void) __attribute__((weak));
>   
>   static char __pidfile[NAME_MAX];
> @@ -206,6 +208,8 @@ void daemonize(int argc, char *argv[])
>   char buf1[256] = { 0 };
>   char buf2[256] = { 0 };
>   
> + internal_version_id_ = strdup("@(#) $Id: " INTERNAL_VERSION_ID " $");
> + 
>   if (argc > 0 && argv != NULL) { 
>   __parse_options(argc, argv);
>   openlog(basename(argv[0]), LOG_PID, LOG_LOCAL0);
> diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
> b/osaf/services/infrastructure/nid/scripts/opensafd.in
> --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
> +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
> @@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
>  osafversion=@OPENSAF_RELEASE@
>   fi
>   
> +osafcshash=@INTERNAL_VERSION_ID@
> +
>   unload_tipc() {
>   
>   # Unload TIPC if already loaded
> @@ -215,7 +217,7 @@ start() {
>   start_daemon $binary $args
>   RETVAL=$?
>   if [ $RETVAL -eq 0 ]; then
> - logger -t $prog "OpenSAF($osafversion) services successfully 
> started"
> + logger -t $prog "OpenSAF($osafversion - $osafcshash) services 
> successfully started"
>   touch $lockfile
>   log_success_msg
>   else


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2013-12-20 Thread Hans Nordebäck
great, I'll check this. Yes it is important that it works for osaf 
distributions. /Regards HansN

Från: Anders Widell
Skickat: den 20 december 2013 11:00
Till: Hans Nordebäck; mathi.naic...@oracle.com
Cc: opensaf-devel@lists.sourceforge.net
Ämne: Re: [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset 
when configuring osaf [#676]

I think something like this could do the trick:

In configure.ac:

INTERNAL_VERSION_ID=0:
AC_SUBST([INTERNAL_VERSION_ID])

In bootstrap.sh:

autoreconf -vi
sed -i "s/^INTERNAL_VERSION_ID=.*\$/INTERNAL_VERSION_ID=$(hg parent
--template "{rev}:{node|short}")/" configure

regards,
Anders Widell

2013-12-19 16:39, Hans Nordeback skrev:
>   Makefile.common  |  4 ++--
>   configure.ac |  2 ++
>   osaf/libs/core/common/daemon.c   |  4 
>   osaf/services/infrastructure/nid/scripts/opensafd.in |  4 +++-
>   4 files changed, 11 insertions(+), 3 deletions(-)
>
>
> Current changeset can be generated and visible in the syslog and in the
> file in question to improve fault analyse. Updated wih review comments.
>
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
>
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
> -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
>   AM_LDFLAGS = -ldl -lrt -lpthread
>
>   #
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,8 @@ AC_USE_SYSTEM_EXTENSIONS
>   OPENSAF_LIB_VERSION=0:0:0
>   AC_SUBST([OPENSAF_LIB_VERSION])
>
> +AC_SUBST([INTERNAL_VERSION_ID],[$(hg parent --template "{rev}:{node|short}") 
> ])
> +
>   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
> executable
>   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" = "yes")
>   #m4_include([m4/linker-script.m4])
> diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
> --- a/osaf/libs/core/common/daemon.c
> +++ b/osaf/libs/core/common/daemon.c
> @@ -43,6 +43,8 @@
>
>   #define DEFAULT_RUNAS_USERNAME  "opensaf"
>
> +static const char* internal_version_id_;
> +
>   extern  void __gcov_flush(void) __attribute__((weak));
>
>   static char __pidfile[NAME_MAX];
> @@ -206,6 +208,8 @@ void daemonize(int argc, char *argv[])
>   char buf1[256] = { 0 };
>   char buf2[256] = { 0 };
>
> + internal_version_id_ = strdup("@(#) $Id: " INTERNAL_VERSION_ID " $");
> +
>   if (argc > 0 && argv != NULL) {
>   __parse_options(argc, argv);
>   openlog(basename(argv[0]), LOG_PID, LOG_LOCAL0);
> diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
> b/osaf/services/infrastructure/nid/scripts/opensafd.in
> --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
> +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
> @@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
>  osafversion=@OPENSAF_RELEASE@
>   fi
>
> +osafcshash=@INTERNAL_VERSION_ID@
> +
>   unload_tipc() {
>
>   # Unload TIPC if already loaded
> @@ -215,7 +217,7 @@ start() {
>   start_daemon $binary $args
>   RETVAL=$?
>   if [ $RETVAL -eq 0 ]; then
> - logger -t $prog "OpenSAF($osafversion) services successfully 
> started"
> + logger -t $prog "OpenSAF($osafversion - $osafcshash) services 
> successfully started"
>   touch $lockfile
>   log_success_msg
>   else


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
___
Opensaf-devel mailing list
Opensaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensaf-devel


Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2014-01-07 Thread Anders Widell
Ack (not tested)

regards,
Anders Widell

2014-01-07 12:35, Hans Nordeback skrev:
>   Makefile.common  |  4 ++--
>   bootstrap.sh |  4 +++-
>   configure.ac |  3 +++
>   osaf/libs/core/common/daemon.c   |  4 
>   osaf/services/infrastructure/nid/scripts/opensafd.in |  4 +++-
>   osaf/services/saf/amf/amfd/main.cc   |  2 ++
>   osaf/services/saf/amf/amfnd/main.cc  |  2 ++
>   7 files changed, 19 insertions(+), 4 deletions(-)
>
>
> Current changeset is visible in the syslog, in corefiles using ident, and also
> in the amfd and amfnd binaries (use ident). Updated wih review comments.
>
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
>   
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@
> -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC 
> -D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ 
> -DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
>   AM_LDFLAGS = -ldl -lrt -lpthread
>   
>   #
> diff --git a/bootstrap.sh b/bootstrap.sh
> --- a/bootstrap.sh
> +++ b/bootstrap.sh
> @@ -1,2 +1,4 @@
>   #! /bin/sh
> -exec autoreconf -vi
> +autoreconf -vi
> +
> +sed -i "s/^INTERNAL_VERSION_ID=.*\$/INTERNAL_VERSION_ID=$(hg parent 
> --template "{rev}:{node|short}")/" configure
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,9 @@ AC_USE_SYSTEM_EXTENSIONS
>   OPENSAF_LIB_VERSION=0:0:0
>   AC_SUBST([OPENSAF_LIB_VERSION])
>   
> +INTERNAL_VERSION_ID=0:
> +AC_SUBST([INTERNAL_VERSION_ID])
> +
>   # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not 
> executable
>   AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" = "yes")
>   #m4_include([m4/linker-script.m4])
> diff --git a/osaf/libs/core/common/daemon.c b/osaf/libs/core/common/daemon.c
> --- a/osaf/libs/core/common/daemon.c
> +++ b/osaf/libs/core/common/daemon.c
> @@ -43,6 +43,8 @@
>   
>   #define DEFAULT_RUNAS_USERNAME  "opensaf"
>   
> +static const char* internal_version_id_;
> +
>   extern  void __gcov_flush(void) __attribute__((weak));
>   
>   static char __pidfile[NAME_MAX];
> @@ -206,6 +208,8 @@ void daemonize(int argc, char *argv[])
>   char buf1[256] = { 0 };
>   char buf2[256] = { 0 };
>   
> + internal_version_id_ = strdup("@(#) $Id: " INTERNAL_VERSION_ID " $");
> + 
>   if (argc > 0 && argv != NULL) { 
>   __parse_options(argc, argv);
>   openlog(basename(argv[0]), LOG_PID, LOG_LOCAL0);
> diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in 
> b/osaf/services/infrastructure/nid/scripts/opensafd.in
> --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
> +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
> @@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
>  osafversion=@OPENSAF_RELEASE@
>   fi
>   
> +osafcshash=@INTERNAL_VERSION_ID@
> +
>   unload_tipc() {
>   
>   # Unload TIPC if already loaded
> @@ -215,7 +217,7 @@ start() {
>   start_daemon $binary $args
>   RETVAL=$?
>   if [ $RETVAL -eq 0 ]; then
> - logger -t $prog "OpenSAF($osafversion) services successfully 
> started"
> + logger -t $prog "OpenSAF($osafversion - $osafcshash) services 
> successfully started"
>   touch $lockfile
>   log_success_msg
>   else
> diff --git a/osaf/services/saf/amf/amfd/main.cc 
> b/osaf/services/saf/amf/amfd/main.cc
> --- a/osaf/services/saf/amf/amfd/main.cc
> +++ b/osaf/services/saf/amf/amfd/main.cc
> @@ -55,6 +55,8 @@
>   #include 
>   #include 
>   
> +static const char* internal_version_id_  __attribute__ ((unused)) = "@(#) 
> $Id: " INTERNAL_VERSION_ID " $";
> +
>   enum {
>   FD_TERM = 0,
>   FD_MBX,
> diff --git a/osaf/services/saf/amf/amfnd/main.cc 
> b/osaf/services/saf/amf/amfnd/main.cc
> --- a/osaf/services/saf/amf/amfnd/main.cc
> +++ b/osaf/services/saf/amf/amfnd/main.cc
> @@ -37,6 +37,8 @@
>   #define FD_CLM   2
>   #define FD_MBCSV 3
>   
> +static const char* internal_version_id_  __attribute__ ((unused)) = "@(#) 
> $Id: " INTERNAL_VERSION_ID " $";
> +
>   static NCS_SEL_OBJ term_sel_obj; /* Selection object for TERM signal events 
> */
>   
>   static void avnd_evt_process(AVND_EVT *);


--
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibi

Re: [devel] [PATCH 1 of 1] osaf: Improve fault analyse by using current changeset when configuring osaf [#676]

2014-01-07 Thread Mathivanan Naickan Palanivelu
Ack.
-Mathi.

> -Original Message-
> From: Hans Nordeback [mailto:hans.nordeb...@ericsson.com]
> Sent: Tuesday, January 07, 2014 5:05 PM
> To: anders.wid...@ericsson.com; Mathivanan Naickan Palanivelu
> Cc: opensaf-devel@lists.sourceforge.net
> Subject: [PATCH 1 of 1] osaf: Improve fault analyse by using current
> changeset when configuring osaf [#676]
> 
>  Makefile.common  |  4 ++--
>  bootstrap.sh |  4 +++-
>  configure.ac |  3 +++
>  osaf/libs/core/common/daemon.c   |  4 
>  osaf/services/infrastructure/nid/scripts/opensafd.in |  4 +++-
>  osaf/services/saf/amf/amfd/main.cc   |  2 ++
>  osaf/services/saf/amf/amfnd/main.cc  |  2 ++
>  7 files changed, 19 insertions(+), 4 deletions(-)
> 
> 
> Current changeset is visible in the syslog, in corefiles using ident, and also
> in the amfd and amfnd binaries (use ident). Updated wih review comments.
> 
> diff --git a/Makefile.common b/Makefile.common
> --- a/Makefile.common
> +++ b/Makefile.common
> @@ -12,8 +12,8 @@ AM_CPPFLAGS = \
>   $(CORE_INCLUDES) \
>   $(all_includes)
> 
> -AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
> @OSAF_HARDEN_FLAGS@
> -AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -
> D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@
> +AM_CFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC
> @OSAF_HARDEN_FLAGS@ -
> DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
> +AM_CXXFLAGS = -Wall -fno-strict-aliasing -Werror -fPIC -
> D__STDC_FORMAT_MACROS @OSAF_HARDEN_FLAGS@ -
> DINTERNAL_VERSION_ID='"@INTERNAL_VERSION_ID@"'
>  AM_LDFLAGS = -ldl -lrt -lpthread
> 
>  #
> diff --git a/bootstrap.sh b/bootstrap.sh
> --- a/bootstrap.sh
> +++ b/bootstrap.sh
> @@ -1,2 +1,4 @@
>  #! /bin/sh
> -exec autoreconf -vi
> +autoreconf -vi
> +
> +sed -i "s/^INTERNAL_VERSION_ID=.*\$/INTERNAL_VERSION_ID=$(hg
> parent --template "{rev}:{node|short}")/" configure
> diff --git a/configure.ac b/configure.ac
> --- a/configure.ac
> +++ b/configure.ac
> @@ -32,6 +32,9 @@ AC_USE_SYSTEM_EXTENSIONS
>  OPENSAF_LIB_VERSION=0:0:0
>  AC_SUBST([OPENSAF_LIB_VERSION])
> 
> +INTERNAL_VERSION_ID=0:
> +AC_SUBST([INTERNAL_VERSION_ID])
> +
>  # FIXME: Until the m4 macro gets cleaned for DSO symbol tests and not
> executable
>  AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "yes" = "yes")
>  #m4_include([m4/linker-script.m4])
> diff --git a/osaf/libs/core/common/daemon.c
> b/osaf/libs/core/common/daemon.c
> --- a/osaf/libs/core/common/daemon.c
> +++ b/osaf/libs/core/common/daemon.c
> @@ -43,6 +43,8 @@
> 
>  #define DEFAULT_RUNAS_USERNAME   "opensaf"
> 
> +static const char* internal_version_id_;
> +
>  extern  void __gcov_flush(void) __attribute__((weak));
> 
>  static char __pidfile[NAME_MAX];
> @@ -206,6 +208,8 @@ void daemonize(int argc, char *argv[])
>   char buf1[256] = { 0 };
>   char buf2[256] = { 0 };
> 
> + internal_version_id_ = strdup("@(#) $Id: " INTERNAL_VERSION_ID "
> $");
> +
>   if (argc > 0 && argv != NULL) {
>   __parse_options(argc, argv);
>   openlog(basename(argv[0]), LOG_PID, LOG_LOCAL0);
> diff --git a/osaf/services/infrastructure/nid/scripts/opensafd.in
> b/osaf/services/infrastructure/nid/scripts/opensafd.in
> --- a/osaf/services/infrastructure/nid/scripts/opensafd.in
> +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in
> @@ -44,6 +44,8 @@ if [ $osafversion = "1" ] ; then
> osafversion=@OPENSAF_RELEASE@
>  fi
> 
> +osafcshash=@INTERNAL_VERSION_ID@
> +
>  unload_tipc() {
> 
>   # Unload TIPC if already loaded
> @@ -215,7 +217,7 @@ start() {
>   start_daemon $binary $args
>   RETVAL=$?
>   if [ $RETVAL -eq 0 ]; then
> - logger -t $prog "OpenSAF($osafversion) services successfully
> started"
> + logger -t $prog "OpenSAF($osafversion - $osafcshash)
> services successfully started"
>   touch $lockfile
>   log_success_msg
>   else
> diff --git a/osaf/services/saf/amf/amfd/main.cc
> b/osaf/services/saf/amf/amfd/main.cc
> --- a/osaf/services/saf/amf/amfd/main.cc
> +++ b/osaf/services/saf/amf/amfd/main.cc
> @@ -55,6 +55,8 @@
>  #include 
>  #include 
> 
> +static const char* internal_version_id_  __attribute__ ((unused)) = "@(#)
> $Id: " INTERNAL_VERSION_ID " $";
> +
>  enum {
>   FD_TERM = 0,
>   FD_MBX,
> diff --git a/osaf/services/saf/amf/amfnd/main.cc
> b/osaf/services/saf/amf/amfnd/main.cc
> --- a/osaf/services/saf/amf/amfnd/main.cc
> +++ b/osaf/services/saf/amf/amfnd/main.cc
> @@ -37,6 +37,8 @@
>  #define FD_CLM   2
>  #define FD_MBCSV 3
> 
> +static const char* internal_version_id_  __attribute__ ((unused)) = "@(#)
> $Id: " INTERNAL_VERSION_ID " $";
> +
>  static NCS_SEL_OBJ term_sel_obj; /* Selection object for TERM signal
> events */
> 
>  static void avnd_evt_process(AVND_EVT *);

---