CONMON-V3(8)
π CONMON-V3(8) β bestie edition π
okay so you're looking at conmon, the OCI container monitor used by Podman and CRI-O, and honestly? she's a tiny little icon who does SO much. this is conmon(8), and we're gonna get through her together, no cap. π«Ά
β¨ NAME β¨
conmon β OCI container monitor used by Podman and CRI-O
πΈ SYNOPSIS πΈ
conmon [OPTIONS] -c CID --runtime PATH
Create/run, exec into, or restore a container while handling logging, exit status reporting, and lifecycle integration for higher-level tools. she's giving multitasking queen π
π¦ DESCRIPTION π¦
conmon is a small, feature-focused OCI container monitor used primarily by Podman and CRI-O. like, she's not trying to be everything, she's just extremely good at her job. π
What she actually does: she launches an OCI runtime (such as runc), keeps track of the container process, manages attach sockets, handles stdio, writes exit status files, and forwards container logs to a pluggable logging backend. iconic behavior, truly.
The same command-line interface supports multiple logical modes:
- Create / run (default): start a container using an OCI bundle. π
- Exec: execute an additional process in an existing container. β¨
- Restore: restore a container from a checkpoint. π§
- Version: print the
conmonversion and exit. β
The mode is selected using flags such as --exec, --restore, and --version β not by subcommands. she does not do subcommands, bestie, that's just not her vibe. π
π OPTIONS π
Unless stated otherwise, boolean options are disabled by default and become enabled when specified. Options marked "(multiple)" may be given more than once. (yes, you can spam them, she's fine with it π«Ά)
π General options
--versionβ Print theconmonversion and exit. that's it, that's the whole thing, she's done here π--api-version=INTβ Conmon API version to use. If omitted, defaults to0. API version affects exec/attach behavior: attaching to an exec session (--exec-attach) is only allowed when--api-versionis at least1. so like, lowkey check your version before you try to attach. π-c,--cid=STRINGβ Container ID. This uniquely identifies the container instance and is required for all modes other than--version. If missing,conmonfails with"Container ID not provided. Use --cid". π¨-u,--cuuid=STRINGβ Container UUID. Required for create/run and restore, and for exec with non-legacy API versions. It may be omitted only for legacy exec mode when--api-versionis less than1and--execis used. Otherwiseconmonfails with"Container UUID not provided. Use --cuuid". π-n,--name=STRINGβ Human-readable container name. This is used in logging metadata and may appear in log records depending on the configured log plugin. it's her government name fr fr π-b,--bundle=PATHβ Location of the OCI bundle directory. If not specified,conmondefaults to the current working directory. The bundle is also used as the default location for theconmondebug log file (see ENVIRONMENT). π¦-r,--runtime=PATHβ Path to the OCI runtime binary used to manage the container (for example,/usr/bin/runc). This option is required for all modes other than--version. The path must refer to an executable file; otherwiseconmonfails with"Runtime path β¦ is not valid". no executable, no entry, periodt. β--runtime-arg=ARG(multiple) β Additional argument to pass to the runtime for all operations. Can be specified multiple times. Values may begin with-. yes you can pass something that starts with a dash, she said what she said π--runtime-opt=ARG(multiple) β Additional options passed to the runtime for restore or exec operations. Can be specified multiple times. Values may begin with-. note: restore or exec only, she's specific like that β¨--persist-dir=PATHβ Persistent directory for the container.conmonwrites exit status files here so higher-level tools can detect container exit usinginotifyor directory polling. the group chat of exit notifications π¬--socket-dir-path=PATHβ Directory where attach sockets for the container are created. If not specified, defaults to/var/run/crio. πΈ--full-attachβ Use the full path to the attach socket instead of truncating it based on--socket-dir-path. When specified,conmonignores--socket-dir-pathfor the attach socket path computation. she said full length or nothing π--sdnotify-socket=PATHβ Path to the host's systemd sd-notify socket. When set,conmonrelays sd-notify messages from the container to this socket. π«Ά--seccomp-notify-socket=PATHβ Path to the socket on which the seccomp notification file descriptor is received. π₯--seccomp-notify-plugins=STRINGβ Comma-separated list or specification of plugins that manage seccomp notifications. The exact semantics are defined by the configured plugins. (so like, ask the plugins, not her π)--timeout,-T=SECONDSβ Kill the container after the specified timeout in seconds. If unset or0,conmondoes not impose a timeout on the container. Negative values are rejected. she will not be doing negative time, that's not a thing π«--syncβ Keep the mainconmonprocess as the direct parent of the container by only forking once. This is mainly useful for debugging or special integration scenarios. one fork and done, main character energy π--syslogβ Log to syslog. This is intended for use with thecgroupfscgroup manager. It controls howconmonitself logs; it is distinct from the container log plugin configured via--log-path. two different logs bestie, do not confuse them π-s,--systemd-cgroupβ Enable systemd-based cgroup management instead ofcgroupfswhen launching or restoring a container. This is passed through as part of the runtime configuration. β¨--no-new-keyringβ Do not create a new session keyring for the container. ππ«--no-pivotβ Disablepivot_root(2)and use alternative root switching mechanisms. π--replace-listen-pidβ Replace an existing listen PID with the OCI runtime PID, when set. This is used by some higher-level integrations for PID tracking. π―--stdin,-iβ Open a pipe to pass standard input to the container. π₯--terminal,-tβ Allocate a pseudo-TTY for the container's stdin/stdout/stderr. she's getting a whole lil screen π₯οΈβ¨
π PID files and exit handling
--conmon-pidfile,-P=PATHβ Write the PID of theconmonmonitor process to the given file. π--container-pidfile,-p=PATHβ Write the PID of the initial process inside the container to the given file. If this option is not provided,conmondefaults to a file namedpidfile-CIDin the current working directory. π«Ά--pidfile=PATH(deprecated) β Deprecated PID file option kept for backward compatibility. Hidden from the built-in help output; prefer--conmon-pidfileor--container-pidfileinstead. it's giving legacy, love her but she's retired π--exit-dir=PATHβ Path to the directory where exit files are written. These files allow higher-level tools such as Podman or CRI-O to detect container exit and read exit status. π¬--exit-command=PATHβ Path to an external program to execute when the container terminates. The exit command receives arguments from--exit-command-argand runs after exit files are written. order matters bestie β¨--exit-command-arg=ARG(multiple) β Additional argument to pass to the program specified by--exit-command. May be specified multiple times. Values may begin with-. π--exit-delay=SECONDSβ Delay, in seconds, before invoking the exit command after container exit. The value must be greater than or equal to0. β³
π₯ Logging options
--log-level=LEVELβ Set the minimum log level forconmon's own debug logging (separate from container logs, again, two different things π€). The supported values follow the typical logging levels (for example,debug,info,warn,error); invalid values are treated according to the internal logger defaults. π-l,--log-path=SPEC(multiple) β Configure container logging destination and plugin. This option can be specified multiple times and is required unless--versionis used. Each value has one of the following forms:plugin:pathβ Use the given plugin and log topath. Dashes in the plugin name are normalized to underscores (for example,k8s-filebecomesk8s_file). πjournaldβ Use thejournaldlogging plugin. π¦syslogβ Use thesysloglogging plugin (writes container output to the system syslog viaopenlog(3)/syslog(3)). Becauseopenlog(3)configures a process-global destination,syslogmay appear at most once among--log-pathvalues; a secondsyslogentry is rejected. one syslog only, she's not doing duplicates πpassthroughβ Use thepassthroughlogging plugin (no additional file path). β¨pathβ Any other non-empty value is treated as a file path for the default file logging plugin. π
If no usable --log-path value is provided, conmon exits with:
Log driver not provided. Use --log-path
π¨
--log-size-max=BYTESβ Maximum size in bytes of a single container log file before rotation or truncation is considered. If unset or0, there is no size-based limit. Negative values (including-1, the historical CRI-O default) also mean unlimited. so-1is not a tiny limit, she means no limit, do not get it twisted π--log-global-size-max=BYTESβ Maximum total size in bytes of all log files managed by the log plugin. If unset or0, there is no global size limit. Negative values (including-1) also mean unlimited. π§--log-tag=STRINGβ Additional tag to include in log records. π·οΈ--log-label=STRING(multiple) β Additional label to include in log records. Can be specified multiple times. π--log-allowlist-dir=PATH(multiple) β Allowed log directory. Can be specified multiple times. When set, the log plugin restricts log writes to the given directories. If omitted, no allowlist restriction is applied. π--no-container-partial-messageβ Do not setCONTAINER_PARTIAL_MESSAGE=truefor partial log lines when using thejournaldlog driver. If specified with a non-journaldplugin,conmonlogs a warning and the option has no effect. sorry bestie, wrong plugin, no effect π--no-sync-logβ Do not manually callsyncon logs after container shutdown. This can improve performance at the cost of potentially losing log records in the event of a sudden system failure. speed vs safety, your call π--log-rotateβ Enable log rotation instead of truncation when--log-size-maxis reached. Rotation requires--log-max-filesto be at least1. π--log-max-files=Nβ Number of backup log files to keep when rotation is enabled. The default is
1
The value must be non-negative; values greater than INT32_MAX are rejected. If --log-rotate is specified and --log-max-files is 0, conmon exits with:
log-max-files must be at least 1 when log-rotate is enabled
π¨
okay that's the first chunk of her, and there's more coming so don't go anywhere π
β¨ Exec and restore options β¨
okay bestie so these options pick and configure exec mode and restore mode, and here's the tea: you cannot just mix and match them however you want. They can't be combined arbitrarily. Periodt. π
-e,--execβ run a command into a container that's already running, instead of making a whole new container. When--execis set:--exec-process-specis required.--cuuidis required too, unless--api-versionis less than1(that's the legacy exec API).--restoremust not be set.
--exec-process-spec=PATHβ the path to the OCI process specification (usually a JSON file, iykyk) that describes the process you wanna execute inside the container. Required whenever--execis used. If you forget it, conmon dips out with"Exec process spec path not provided. Use --exec-process-spec". π--exec-attachβ attach to an exec session. This one's only valid when--execis also specified, and when--api-versionis at least1. Use it without--execand conmon fails with"Attach can only be specified with exec". Use it with--api-versionless than1and conmon fails with"Attach can only be specified for a non-legacy exec session". π«--restore=PATHβ restore a container from a previously created checkpoint at the path you give it. When--restoreis used:--execmust not be set (conmon straight up rejects configs that use both).--cid,--cuuid, and--runtimeare still required.
--restore-arg=ARG(deprecated, multiple) β an extra argument to pass to the restore command. It's deprecated and hidden from the built-in help, but it's still parsed for backward compatibility. Values may begin with-. π
π¦ Attach and I/O behavior π¦
--leave-stdin-openβ leave standard input open when the attached client disconnects, instead of closing the container's stdin.
π Mode selection summary π
conmon picks its internal command mode based on the options you hand it, bestie. Here's the vibe check:
- Version mode
- Selected when
--versionis specified. - Prints version information and exits immediately.
- Selected when
- Restore mode
- Selected when
--restoreis provided (and--execis not). - Restores a container from the checkpoint path you specified.
- Selected when
- Exec mode
- Selected when
--execis set (and--restoreis not). - Runs an additional process in an existing container using
--exec-process-spec, optionally with--exec-attach.
- Selected when
- Create / run mode
- The default when neither
--execnor--restorenor--versionis set. - Creates and runs a new container using the OCI bundle at
--bundle(or the current working directory by default).
- The default when neither
πΈ ENVIRONMENT πΈ
These environment variables affect conmon's own debug logging. Important: they do not control the container log plugin β that one is configured via --log-path and related CLI options. Two totally different things, don't get it twisted. β¨
CONMON_LOG_PATHβ path to the debug log file for conmon itself. If it's not set, and--bundleis provided, conmon defaults to writing its debug log toBUNDLE/conmon-debug.log. If neitherCONMON_LOG_PATHnor--bundleis set, then no debug log file path is configured at all. πCONMON_LOG_LEVELβ minimum log level for conmon's internal debug logging. If it's not set, or set to an invalid value, conmon defaults to a debug-level log filter.
π EXIT STATUS π
On success, conmon exits with the exit status of the container or the exec process, depending on which mode is active. On internal errors (invalid arguments, runtime failures, logging misconfiguration, and stuff like that), conmon prints an error message that looks exactly like this:
conmon: MESSAGE
and exits with an appropriate non-zero status code.
In all normal cases, conmon:
- Writes exit files into the directory specified by
--persist-dirand/or--exit-dir, so higher-level tools can detect container exit and read the exit status. - Flushes any buffered container log output in the configured log plugin before exiting.
- Optionally runs the program specified by
--exit-command, passing any--exit-command-argvalues, after an optional--exit-delay.
π EXAMPLES π
Create and run a container using an OCI bundle in the current directory, logging to a file:
conmon \
--cid mycid \
--cuuid 123e4567-e89b-12d3-a456-426655440000 \
--runtime /usr/bin/runc \
--log-path /var/log/containers/mycid.log
Exec a process in a running container with attach, using API version 1 and a process spec:
conmon \
--cid mycid \
--cuuid 123e4567-e89b-12d3-a456-426655440000 \
--runtime /usr/bin/runc \
--api-version 1 \
--exec \
--exec-process-spec /run/mycid/exec-spec.json \
--exec-attach \
--log-path passthrough
Restore a container from a checkpoint with systemd cgroups enabled:
conmon \
--cid mycid \
--cuuid 123e4567-e89b-12d3-a456-426655440000 \
--runtime /usr/bin/runc \
--restore /var/lib/checkpoints/mycid \
--systemd-cgroup \
--log-path file:/var/log/containers/mycid.log
π SEE ALSO π
and that's the whole page bestie, we ate and left absolutely no crumbs π β¨ the source and version info are chilling down in the footer along with the date, so if you ever need to know exactly which build of conmon(8) you're reading, that's where you look. now go monitor some containers, main character π«Άπ
π¦ where this page comes from
- fedora 43: conmon-v3 3.0.0~dev-5.20261007092403828293.main.69.g3f6f404.fc43 Β· Apache-2.0 AND MIT AND Unicode-3.0 AND BSL-1.0 AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND Unlicense
- fedora 44: conmon-v3 3.0.0~dev-5.20261007092403828293.main.69.g3f6f404.fc44 Β· Apache-2.0 AND MIT AND Unicode-3.0 AND BSL-1.0 AND LGPL-2.1-or-later WITH GCC-exception-2.0 AND Unlicense
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms