Skip to content

podman-compose systemd generates unit files assuming podman executable at /usr/bin/podman, instead of the actual path /usr/local/bin/podman #1306

@ccll

Description

@ccll

Describe the bug
I have a docker-compose project migrated to podman-compose, trying to generate systemd unit files, but the podman path is wrong in all the unit files.

To Reproduce
Steps to reproduce the behavior:

  1. the current working directory have docker-compose.yml which defines a single service.
  2. run podman-compose up -d to bring up the service container
  3. run podman-compose systemd -a create-unit and podman-compose systemd -a register to generate the systemd unit files
  4. the generated unit file have a line ExecStartPre=/usr/bin/podman pod start pod_%i, but my podman executable is actually installed at /usr/local/bin/podman, so the unit file would fail to start.

please use minimal reproducible example for example give me a small busybox-based compose yaml

Expected behavior
The systemd service should start without problem.

Actual behavior
The podman executable path is wrong so the systemd service fail to start.

Output

$ podman-compose version
podman-compose version 1.5.0
podman version 5.6.1

$ podman-compose systemd -a create-unit

while in your project type `podman-compose systemd -a register`

$ podman-compose systemd -a register

you can use systemd commands like enable, start, stop, status, cat all without `sudo` like this:

    systemctl --user enable --now 'podman-compose@drone-runner'
    systemctl --user status 'podman-compose@drone-runner'
    journalctl --user -xeu 'podman-compose@drone-runner'

and for that to work outside a session
you might need to run the following command *once*

    sudo loginctl enable-linger 'root'

you can use podman commands like:

    podman pod ps
    podman pod stats 'pod_drone-runner'
    podman pod logs --tail=10 -f 'pod_drone-runner'

Environment:

$ cat /etc/os-release
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.4 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy

Additional context

Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions