Skip to content

Commit

Permalink
Some other review changes made
Browse files Browse the repository at this point in the history
  • Loading branch information
tdrauncieal committed May 8, 2024
1 parent e9caab4 commit e1cf984
Showing 1 changed file with 20 additions and 19 deletions.
39 changes: 20 additions & 19 deletions source/development/coredump.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,24 @@ Using `systemd`

Systemd allows centralized management and configuration of core dumps across your system. To set up core dump generation with systemd, use the built-in features as follows.

#. **Check Core Dump Configuration**:
First, verify the current core dump configuration:
#. Check that the Systemd core dump unit socket is active.

.. code-block:: console
# systemctl status systemd-coredump*
.. code-block:: none
:class: output
:emphasize-lines: 3
● systemd-coredump.socket - Process Core Dump Socket
Loaded: loaded (/lib/systemd/system/systemd-coredump.socket; static)
Active: active (listening) ...
#. **Identify Target Directory for Core Dumps**:
Choose a directory where core dump files will be generated. By default, systemd stores core dump files in ``/var/lib/systemd/coredump/``.
Take a look the directory where core dump files will be generated. By default, systemd stores core dump files in ``/var/lib/systemd/coredump/``.

Below is how to consult the set configuration, generally ``systemd`` uses piping to process the data.

.. code-block:: console
Expand All @@ -44,8 +46,7 @@ Systemd allows centralized management and configuration of core dumps across you
│|/lib/systemd/systemd-coredump %P %u %g %s %t
#. **Enable Core Dump Collection**:
Enable core dump collection by setting the ``Storage=`` option in the systemd ``coredump.conf`` file. You can set it to ``external`` to store core dumps externally, or ``none`` to disable core dump collection altogether.
#. Edit the Systemd ``/etc/systemd/coredump.conf`` file.

.. code-block:: console
Expand Down Expand Up @@ -82,7 +83,7 @@ Manual configuration
Setting up core dump generation without using systemd involves configuring the operating system core dump settings manually.

#. **Set the Core Dump Size Limit**:
If the current core dump size limit is insufficient, increase it using the ``ulimit`` command. For example, to set the core dump size limit to unlimited:
Set the core dump size limit to unlimited:

.. code-block:: console
Expand All @@ -98,7 +99,7 @@ Setting up core dump generation without using systemd involves configuring the o
#. **Automate Configuration (Optional)**:
To preserve these changes across reboots, add the ``ulimit`` command and ``echo`` command setting ``core_pattern`` to a startup script or system initialization script (e.g., ``/etc/rc.local``).

By following these steps, you can set up core dump generation manually without relying on systemd. However, keep in mind that the process may vary slightly depending on the Linux distribution and version you are using.
By following these steps, you can set up core dump generation manually without relying on systemd.


To disable core dump generation you can directly adjust system-wide settings and configurations. Here's how you can do it:
Expand All @@ -125,36 +126,36 @@ To disable core dump generation you can directly adjust system-wide settings an

By following these steps, you can disable core dump generation without relying on systemd. This approach directly modifies system-wide settings to prevent core dumps from being generated.

MacOS agent's OS
----------------
On macOS, core dump generation is disabled by default for most applications. However, you can enable core dump generation for specific processes using the ``ulimit`` command. Here's how you can enable core dump generation on macOS:
MacOS endpoints
---------------
On macOS, most applications have core dump generation disabled by default. However, you can enable it using the ``ulimit`` command. To enable core dump generation on macOS follow these steps.

#. **Check Current Core Dump Configuration**:
Before enabling core dump generation, check the current core dump size limit using the ``ulimit`` command:
#. Check the current core dump size limit using the ``ulimit`` command.

.. code-block:: console
# ulimit -c
# sysctl kern.corefile
#. **Identify the Target Directory for Core Dumps**:
On macOS, core dump files are typically stored in the current working directory of the process that crashes.
#. **Enable Core Dump Generation**:
To enable core dump generation for a specific process, set the core dump size limit to a non-zero value using the ``ulimit`` command. For example, to set the limit to unlimited:
To enable core dump generation, set the core dump size limit to a non-zero value using the ``ulimit`` command. For example, to set the limit to unlimited:

.. code-block:: console
# ulimit -c unlimited
#. **Set Core Dump Generation path**:

.. code-block:: console
# sysctl -w kern.corefile=/cores/core.%P
By following these steps, you can enable core dump generation for specific processes on macOS. Keep in mind that enabling core dump generation may consume additional disk space, so use it judiciously. Additionally, core dump generation may not be supported or may behave differently for all processes on macOS.
By following these steps, you can enable core dump generation on macOS. Keep in mind that enabling core dump generation may consume additional disk space, so use it judiciously. Additionally, core dump generation may not be supported or may behave differently for all processes on macOS.

To disable coredump generation, you can ensure that core dumps are not generated by setting the core dump size limit to zero. Here's how you can disable core dump generation on macOS:

.. code-block:: console
# ulimit -c 0
By setting the core dump size limit to zero, you ensure that core dumps are not generated for any processes on macOS. Keep in mind that this setting affects the entire system and may impact troubleshooting capabilities in case of application crashes.
By setting the core dump size limit to zero, you ensure that core dumps are not generated for any processes on macOS.

0 comments on commit e1cf984

Please sign in to comment.