MINICOREDUMPER.CFG.JSON(5)

πŸ’– minicoredump────er.cfg.json β€” bestie edition πŸ’–

okay so this is the manual page for minicoredumper.cfg.json(5), aka THE main character config file for minicoredumper(8). she's a section 5 page (file formats, fancy), she's been around since 2016-09-16, and she ships with minicoredumper. let's get into it πŸ’…


✨ NAME ✨

minicoredumper.cfg.json β€” the main configuration file for minicoredumper(8)


πŸŽ€ DESCRIPTION πŸŽ€

minicoredumper.cfg.json is the main configuration file for minicoredumper(8). she serves 2 purposes and honestly? both iconic:

  1. define where dumped files should be located πŸ“
  2. specify various minicoredumper(8) recepts for various conditions 🧚

🌸 FILE FORMAT 🌸

the file uses the JSON format. the options are:

  • base_dir β€” (string) the root directory where the dumped data will be stored. the dump files will be stored in a sub-directory using the template: <command_basename>.<timestamp>.<pid>
  • watch β€” (array) a set of conditions, where each condition can specify its own recept file. see CONDITIONS for configuration options for a condition.

πŸ¦‹ CONDITIONS πŸ¦‹

a condition can contain any combination of these options:

  • exe β€” (string) the full path to the binary being executed as returned by readlink(2).
  • comm β€” (string) the basename of the command that was run (the 7th argument of the minicoredumper(8) call).
  • recept β€” (string) the full path to the recept file to use if this condition matches.

both exe and comm can contain the * character for wildcard matching. slay πŸ”₯

the conditions are checked to find a match in the order specified. the first match will cause the minicoredumper to use the recept for that condition. if no conditions match, the minicoredumper will exit and no core(5) dump will be generated. πŸ’€

if exe and/or comm are not specified for a condition, they will use a default value "*".

if recept is not specified for a condition, the built-in minicoredumper defaults are used.

exe and comm have a "logical AND" relationship. a "logical OR" behavior can be achieved by specifying one condition with only exe and another condition with only comm. the way that logic works is honestly giving computer science class and we love her for it 🫢


πŸ’œ NOTES πŸ’œ

the exact path where data is dumped is logged to syslog(3). so if you're ever like "where did my dump go 😭" β€” go check the logs bestie.

if an 8th argument of minicoredumper(8) is provided, the name and location of this file will depend on that value. iykyk.


🌈 EXAMPLES 🌈

here is an example configuration file:

{
    "base_dir": "/tmp",
    "watch": [
        {
            "exe": "*/my_example_app",
            "recept": "/etc/minicoredumper/example.recept.json"
        },
        {
            "comm": "example_app"
            "recept": "/etc/minicoredumper/example.recept.json"
        },
        {
            "exe": "/bin/*"
        },
        {
            "recept": "/etc/minicoredumper/generic.recept.json"
        }
    ]
}

in this example, dumped data will be stored in a directory named:

/tmp/<command_basename>.<timestamp>.<pid>

for example, if there is a symbolic link:

/usr/bin/example_app -> /opt/my_apps/bin/my_example_app

and the user runs "example_app" and it crashes, the newly created files could be found here:

/tmp/example_app.20151103.114054+0100.15143

the example above contains 4 conditions that will be checked in order. let's walk through them, one by one, because the way this cascades is genuinely so satisfying:

  1. the first condition will match if the binary "*/my_example_app" caused the core dump. it will use the recept file: /etc/minicoredumper/example.recept.json
  2. the second condition will match if the basename of the command is "example_app". it will also use the recept file: /etc/minicoredumper/example.recept.json
  3. the third condition will match for any binaries under "/bin/*". it will use the built-in minicoredumper(8) defaults.
  4. the fourth condition will match everything. it will use the recept file: /etc/minicoredumper/generic.recept.json

in the example where the user runs "example_app", the first condition will match since example_app is a symbolic link to /opt/my_apps/bin/my_example_app. first-match-wins behavior, we love a decisive queen πŸ‘‘

a minimal (yet still useful) configuration file could look like this:

{
    "base_dir": "/tmp",
    "watch": [
        {
            "exe": "*"
        }
    ]
}

πŸ“ FILES πŸ“

/etc/minicoredumper/minicoredumper.cfg.json


⭐ SEE ALSO ⭐

minicoredumper(8), libminicoredumper(7), minicoredumper.recept.json(5)

the DiaMon Workgroup: <http://www.diamon.org>


and that's the whole page, bestie β€” go configure ur coredumps and live ur truth πŸ’–βœ¨

this has been minicoredumper, MINICOREDUMPER.CFG.JSON(5), dated 2016-09-16. periodt. πŸ’…πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from