This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag

ホームページ

サイトについて

コンタクト情報

使用条件

協力方法

セキュリティ

This web page is no longer maintained. Information presented here exists only to avoid breaking historical links.
The Project stays maintained, and lives on: see the Linux-HA Reference Documentation.
To get rid of this notice, you may want to browse the old wiki instead.

2010.1.28
追加パッケージ集リニューアル
追加パッケージ集は、こちらから

2008.8.28
RHEL用rpm更新
更新情報はこちらから

2008.8.18
Heartbeat 2.1.4
リリース!
Downloadはこちらから

2007.11.13
Linux-ha-japan日本語ML移植しました

2007.10.5
日本語サイトOPEN
日本語MLも開設しました

2007.10.5
OSC2007 Tokyo/Fall で Heartbeat紹介
発表資料を公開しました

Last site update:
2017-12-12 18:12:57

Getting Core Dumps

It can be difficult to get core dumps for Heartbeat - because the code is security conscious and switches user ids back and forth to make it difficult to exploit the code to get root permissions. We have made progress on this, and so have the OS vendors, so these descriptions have several parts depending on what version and OS you're running.

  1. General Core Dump Enabling

    1. If your version of Heartbeat supports a coredumps directive, you should enable it.

    2. If your version does not support the coredumps directive, then you should start Heartbeat from a shell where you've executed this command:

      ulimit -c unlimited
      
      otherwise all core dumps will likely be prohibited.
  2. Enabling unique core files

    If your kernel has the /proc file /proc/sys/kernel/core_uses_pid, then you should execute this command: echo 1 > /proc/sys/kernel/core_uses_pid. If your kernel doesn't support this, then it's probably not a problem, but enable it if you can.

  3. Enabling core dumps for setuid processes

    1. Release 2 should not need this step (if seems to need this, please let us know).

    2. If you're running a kernel which has the file /proc/sys/kernel/suid_dumpable, then you should execute this command: echo 2 > /proc/sys/kernel/suid_dumpable.

    3. If you're not running release 2, and your kernel does not support the suid_dumpable capability and the process which is dying and should produce a core dump isn't, then you will likely have to make a source change to Heartbeat and recompile.

      The source file you want to change is lib/clplumbing/uids.c. This file ought to start with a section of code that looks about like this:

      int     /* Become nobody - and remember our original privileges */
      drop_privs(uid_t uid, gid_t gid)
      {
              int     rc;
              gid_t   curgid = getgid();
      
              if (!anysaveduid) {
                      poweruid=getuid();
                      powergid=curgid;
              }
      

      We need to make this code into a no-op, so inserting a return after the declarations ought to do it.

      int     /* Become nobody - and remember our original privileges */
      drop_privs(uid_t uid, gid_t gid)
      {
              int     rc;
              gid_t   curgid = getgid();
      
              return; /* Disable security precautions DON'T LEAVE THIS IN HERE FOREVER! */
      
              if (!anysaveduid) {
                      poweruid=getuid();
                      powergid=curgid;
              }
      

      Now, recompile and reinstall Heartbeat.

  4. Core dump locations. Heartbeat core dumps should show up in one of these two locations - depending on the release of Heartbeat you're using:

    • /etc/ha.d

    • /var/lib/heartbeat/cores/*

Now, you should get core dumps when a Heartbeat process ought to core dump.

See Also

coredumps directive, suid_dumpable patch