Menu

#230 core files are not getting formed for opensaf processes running with user opensaf

future
unassigned
nobody
None
enhancement
osaf
-
minor
2017-04-03
2013-05-15
No

Opensaf is running with user opensaf. Now did a 'kill -6 <pid>' of one of the processes running with opensaf user. When tried the command on Node Directors, they restarted but no corefile is observed in /var/crash/opensaf. When other processes which are running with other users are killed, core file got generated. </pid>

Discussion

  • Mathi Naickan

    Mathi Naickan - 2013-07-26
    • Milestone: 4.2.4 --> future
     
  • Adrian Szwej

    Adrian Szwej - 2014-10-01

    The following changes enable coredumps.

    diff -r ead18326c13b osaf/libs/core/common/daemon.c
    --- a/osaf/libs/core/common/daemon.c    Fri Sep 26 08:53:42 2014 +0200
    +++ b/osaf/libs/core/common/daemon.c    Wed Oct 01 23:14:08 2014 +0000
    @@ -31,6 +31,7 @@
     #include <limits.h>
     #include <sys/stat.h>
     #include <sys/file.h>
    +#include <sys/prctl.h>
    
     #include <configmake.h>
    
    @@ -324,6 +325,7 @@
                    syslog(LOG_ERR, "setuid failed, uid=%d (%s)", pw->pw_uid, strerror(errno));
                    exit(EXIT_FAILURE);
                }
    +                        prctl(PR_SET_DUMPABLE, 1,0,0,0);
            } else {
                syslog(LOG_ERR, "invalid user name %s", __runas_username);
                exit(EXIT_FAILURE);
    diff -r ead18326c13b osaf/services/infrastructure/nid/scripts/opensafd.in
    --- a/osaf/services/infrastructure/nid/scripts/opensafd.in  Fri Sep 26 08:53:42 2014 +0200
    +++ b/osaf/services/infrastructure/nid/scripts/opensafd.in  Wed Oct 01 23:14:08 2014 +0000
    @@ -98,12 +98,19 @@
     }
    
     enable_coredump() {
    +        core_destination="/var/crash/opensaf"
        core_size="unlimited"
        core_pattern="/var/crash/opensaf/core_%t.%e.%p"
    
    -   if [ ! -d /var/crash/opensaf ]; then
    -       mkdir -p /var/crash/opensaf
    -   fi
    +        if [ ! -d ${core_destination} ]; then
    +                mkdir -p ${core_destination}
    +                if [ -n "$OPENSAF_GROUP" ]; then
    +                        getent group $OPENSAF_GROUP > /dev/null && chgrp $OPENSAF_GROUP ${core_destination}
    +                fi
    +                if [ -n "$OPENSAF_USER" ]; then
    +                        getent passwd $OPENSAF_USER > /dev/null && chown $OPENSAF_USER ${core_destination}
    +                fi
    +        fi
    
        if [ `ulimit -c` = 0 ]; then
            ulimit -c $core_size
    
     
  • Anders Bjornerstedt

    • Type: defect --> enhancement
     

Log in to post a comment.