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:000000000000
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

Reply via email to