Answers: <p>This functionality is left to the ContainerEngine for implementation.</p>
  <h1>Pause is suspend</h1>
  <p>Pause does some voodoo with freezing cgroups you can see this in the code to <a href="https://github.com/containers/crun/blob/main/src/libcrun/cgroup-utils.c#L620" rel="nofollow noreferrer"><code>crun</code> in <code>libcrun_cgroup_pause_unpause_with_mode</code> (which handles pause and unpause)</a>. Tasks do not know when they're frozen it happens in the kernel, according to the docs on <a href="https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/freezer-subsystem.html#cgroup-freezer" rel="nofollow noreferrer">cgroup v1's freeze</a>,</p>
  <blockquote>
  <p>In contrast, the cgroup freezer uses the kernel freezer code to prevent the freeze/unfreeze cycle from becoming visible to the tasks being frozen. This allows the bash example above and gdb to run as expected.</p>
  </blockquote>
  <p>Pause set the container's cgroup status to thawed, freezing, or frozen.</p>
  <h1>Stop kills</h1>
  <p>Stop will send <code>SIGKILL</code> or <code>SIGINT</code> depending on if there is a timeout. This functionality is not in <code>crun</code> but in <code>podman</code> (confirmed by checking <code>man crun</code> and in source).</p>
  
Answers: CC BY-SA 4.0
Answers: 2024-05-06T01:50:25.050Z
Answers: 2024-05-06T01:50:25.050Z
Answers: Evan Carroll
Body: <p><code>podman pause</code> is listed as &quot;pause a container&quot; in <code>--help</code>, while <code>podman stop</code> is listed as &quot;stop a container&quot; what's the difference between these two commands?</p>
  
Tags: <podman>
Title: podman pause vs podman stop: what's the difference?
UserDisplayName: Evan Carroll
ThreadText: # podman pause vs podman stop: what's the difference?
  
  (Asked by: username_0 on 2024-05-06)
  
  `podman pause` is listed as "pause a container" in `--help`, while `podman stop` is listed as "stop a container" what's the difference between these two commands?
  
  **Tags:** podman
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2024-05-06. Score: 1
  
  This functionality is left to the ContainerEngine for implementation.
  
  # Pause is suspend
  
  Pause does some voodoo with freezing cgroups you can see this in the code to [`crun` in `libcrun_cgroup_pause_unpause_with_mode` (which handles pause and unpause)](https://github.com/containers/crun/blob/main/src/libcrun/cgroup-utils.c#L620). Tasks do not know when they're frozen it happens in the kernel, according to the docs on [cgroup v1's freeze](https://www.kernel.org/doc/html/latest/admin-guide/cgroup-v1/freezer-subsystem.html#cgroup-freezer),
  
  > In contrast, the cgroup freezer uses the kernel freezer code to prevent the freeze/unfreeze cycle from becoming visible to the tasks being frozen. This allows the bash example above and gdb to run as expected.
  
  Pause set the container's cgroup status to thawed, freezing, or frozen.
  
  # Stop kills
  
  Stop will send `SIGKILL` or `SIGINT` depending on if there is a timeout. This functionality is not in `crun` but in `podman` (confirmed by checking `man crun` and in source).
  
  
  ---
  
  