Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"podman generate systemd" produces different results for "--sdnotify conmon" and "--sdnotify=conmon" #15052

Closed
eriksjolund opened this issue Jul 25, 2022 · 1 comment · Fixed by #15056
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@eriksjolund
Copy link
Contributor

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)

/kind bug

Description

podman generate systemd produces different results for containers created with --sdnotify conmon and those created with --sdnotify=conmon

Steps to reproduce the issue:

  1. Create the file test.sh with this file contents

    #!/bin/sh
    set -o errexit
    set -o nounset
    
    ctr=$(podman run  --rm -d $@ docker.io/library/nginx)
    (podman generate systemd --new $ctr | grep -- --sdnotify) || true
    podman container rm -f $ctr > /dev/null
    
  2. Run these commands

    $ bash test.sh
        --sdnotify=conmon \
    $ bash test.sh --sdnotify conmon
    $ bash test.sh --sdnotify=conmon
        --sdnotify=conmon docker.io/library/nginx
    

Describe the results you received:

$ bash test.sh --sdnotify conmon
$

Describe the results you expected:

$ bash test.sh --sdnotify conmon
    --sdnotify=conmon docker.io/library/nginx
$

Additional information you deem important (e.g. issue happens only occasionally):

Testing some other values

$ bash test.sh --sdnotify container
$ bash test.sh --sdnotify=container
    --sdnotify=container docker.io/library/nginx
$ bash test.sh --sdnotify ignore
$ bash test.sh --sdnotify=ignore
    --sdnotify=ignore docker.io/library/nginx
$

Output of podman version:

Client:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.3
Built:        Wed Jun 22 18:17:44 2022
OS/Arch:      linux/amd64

Output of podman info --debug:

Client:       Podman Engine
Version:      4.1.1
API Version:  4.1.1
Go Version:   go1.18.3
Built:        Wed Jun 22 18:17:44 2022
OS/Arch:      linux/amd64
[test179@asus user]$ podman info --debug
host:
  arch: amd64
  buildahVersion: 1.26.1
  cgroupControllers:
  - cpu
  - io
  - memory
  - pids
  cgroupManager: systemd
  cgroupVersion: v2
  conmon:
    package: conmon-2.1.0-2.fc36.x86_64
    path: /usr/bin/conmon
    version: 'conmon version 2.1.0, commit: '
  cpuUtilization:
    idlePercent: 99.91
    systemPercent: 0.03
    userPercent: 0.05
  cpus: 16
  distribution:
    distribution: fedora
    variant: workstation
    version: "36"
  eventLogger: journald
  hostname: asus
  idMappings:
    gidmap:
    - container_id: 0
      host_id: 1090
      size: 1
    - container_id: 1
      host_id: 5756448
      size: 65536
    uidmap:
    - container_id: 0
      host_id: 1090
      size: 1
    - container_id: 1
      host_id: 5756448
      size: 65536
  kernel: 5.18.13-200.fc36.x86_64
  linkmode: dynamic
  logDriver: journald
  memFree: 134475776
  memTotal: 7578865664
  networkBackend: netavark
  ociRuntime:
    name: crun
    package: crun-1.5-1.fc36.x86_64
    path: /usr/bin/crun
    version: |-
      crun version 1.5
      commit: 54ebb8ca8bf7e6ddae2eb919f5b82d1d96863dea
      spec: 1.0.0
      +SYSTEMD +SELINUX +APPARMOR +CAP +SECCOMP +EBPF +CRIU +YAJL
  os: linux
  remoteSocket:
    path: /run/user/1090/podman/podman.sock
  security:
    apparmorEnabled: false
    capabilities: CAP_CHOWN,CAP_DAC_OVERRIDE,CAP_FOWNER,CAP_FSETID,CAP_KILL,CAP_NET_BIND_SERVICE,CAP_SETFCAP,CAP_SETGID,CAP_SETPCAP,CAP_SETUID,CAP_SYS_CHROOT
    rootless: true
    seccompEnabled: true
    seccompProfilePath: /usr/share/containers/seccomp.json
    selinuxEnabled: true
  serviceIsRemote: false
  slirp4netns:
    executable: /usr/bin/slirp4netns
    package: slirp4netns-1.2.0-0.2.beta.0.fc36.x86_64
    version: |-
      slirp4netns version 1.2.0-beta.0
      commit: 477db14a24ff1a3de3a705e51ca2c4c1fe3dda64
      libslirp: 4.6.1
      SLIRP_CONFIG_VERSION_MAX: 3
      libseccomp: 2.5.3
  swapFree: 7575957504
  swapTotal: 7578054656
  uptime: 15h 42m 53.52s (Approximately 0.62 days)
plugins:
  log:
  - k8s-file
  - none
  - passthrough
  - journald
  network:
  - bridge
  - macvlan
  volume:
  - local
registries:
  search:
  - registry.fedoraproject.org
  - registry.access.redhat.com
  - docker.io
  - quay.io
store:
  configFile: /home/test179/.config/containers/storage.conf
  containerStore:
    number: 11
    paused: 0
    running: 4
    stopped: 7
  graphDriverName: overlay
  graphOptions: {}
  graphRoot: /home/test179/.local/share/containers/storage
  graphRootAllocated: 407822663680
  graphRootUsed: 362134671360
  graphStatus:
    Backing Filesystem: xfs
    Native Overlay Diff: "true"
    Supports d_type: "true"
    Using metacopy: "false"
  imageCopyTmpDir: /var/tmp
  imageStore:
    number: 168
  runRoot: /run/user/1090/containers
  volumePath: /home/test179/.local/share/containers/storage/volumes
version:
  APIVersion: 4.1.1
  Built: 1655914664
  BuiltTime: Wed Jun 22 18:17:44 2022
  GitCommit: ""
  GoVersion: go1.18.3
  Os: linux
  OsArch: linux/amd64
  Version: 4.1.1

Package info (e.g. output of rpm -q podman or apt list podman):

podman-4.1.1-2.fc36.x86_64

Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)

Yes

Additional environment details (AWS, VirtualBox, physical, etc.):

$ rpm -q crun
crun-1.5-1.fc36.x86_64
$ rpm -qi crun
Name        : crun
Version     : 1.5
Release     : 1.fc36
Architecture: x86_64
Install Date: Sun 24 Jul 2022 07:25:19 AM CEST
Group       : Unspecified
Size        : 436028
License     : GPLv2+
Signature   : RSA/SHA256, Wed 20 Jul 2022 10:12:25 PM CEST, Key ID 999f7cbf38ab71f4
Source RPM  : crun-1.5-1.fc36.src.rpm
Build Date  : Wed 20 Jul 2022 08:43:40 PM CEST
Build Host  : buildvm-x86-09.iad2.fedoraproject.org
Packager    : Fedora Project
Vendor      : Fedora Project
URL         : https://github.com/containers/crun
Bug URL     : https://bugz.fedoraproject.org/crun
Summary     : OCI runtime written in C
Description :
crun is a runtime for running OCI containers
@Luap99
Copy link
Member

Luap99 commented Jul 25, 2022

great find, this should be a simple fix

Luap99 added a commit to Luap99/libpod that referenced this issue Jul 25, 2022
When a container was created with `--sdnotify value` we would remove
this arg instead of using it like with `--sdnotfiy=value`.

Also when the arg is set to ignore we should force conmon in order to
make the resulting Type=notify units work.

Fixes containers#15052

Signed-off-by: Paul Holzinger <[email protected]>
mheon pushed a commit to mheon/libpod that referenced this issue Aug 10, 2022
When a container was created with `--sdnotify value` we would remove
this arg instead of using it like with `--sdnotfiy=value`.

Also when the arg is set to ignore we should force conmon in order to
make the resulting Type=notify units work.

Fixes containers#15052

Signed-off-by: Paul Holzinger <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants