Skip to content

[email protected] Should be modified because of pod creation disabled by default #695

Closed
@yanghl12138

Description

@yanghl12138

Describe the bug
Because pod are not created by default#673, [email protected] Should be modified

This is the file generated by podman-compose systemd -a create-unit

[Unit]
Description=%i rootless pod (podman-compose)

[Service]
Type=simple
EnvironmentFile=%h/.config/containers/compose/projects/%i.env
ExecStartPre=-/usr/bin/podman-compose up --no-start
ExecStartPre=/usr/bin/podman pod start pod_%i
ExecStart=/usr/bin/podman-compose wait
ExecStop=/usr/bin/podman pod stop pod_%i

[Install]
WantedBy=default.target

The line

ExecStartPre=-/usr/bin/podman-compose up --no-start

should be

ExecStartPre=-/usr/bin/podman-compose --in-pod=1 up --no-start

To Reproduce

version: "3.1"

services:
  test:
    image: busybox
    command: sh -c "while [[ 1 ]]; do uname -msr; sleep 5; done"
sudo podman-compose systemd -a create-unit
systemctl --user daemon-reload
podman-compose systemd -a register
podman-compose down
systemctl --user start 'podman-compose@busybox'
podman pod stats 'pod_busybox'

Expected behavior
Create pod_busybox and start the service using systemd command.

Actual behavior
No pod created.

Output

> systemctl --user status 'podman-compose@busybox'
× [email protected] - busybox rootless pod (podman-compose)
     Loaded: loaded (/etc/xdg/systemd/user/[email protected]; disabled; preset: disabled)
    Drop-In: /usr/lib/systemd/user/service.d
             └─10-timeout-abort.conf
     Active: failed (Result: exit-code) since Wed 2023-05-17 11:18:51 CST; 4min 15s ago
    Process: 120985 ExecStartPre=/usr/bin/podman-compose up --no-start (code=exited, status=0/SUCCESS)
    Process: 121014 ExecStartPre=/usr/bin/podman pod start pod_busybox (code=exited, status=125)
        CPU: 801ms

May 17 11:18:49 server.fedora podman-compose[120985]: ['podman', 'network', 'exists', 'busybox_default']
May 17 11:18:49 server.fedora podman-compose[120985]: podman create --name=busybox_test_1 --label io.podman.compose.config-hash=e36d575a906>
May 17 11:18:49 server.fedora podman[121007]: 2023-05-17 11:18:49.886335646 +0800 CST m=+0.077186105 image pull beae173ccac6ad749f76713cf44>
May 17 11:18:50 server.fedora podman[121007]: 2023-05-17 11:18:50.183193284 +0800 CST m=+0.374045000 container create 6b3e3ed8dd85f507a09a9>
May 17 11:18:50 server.fedora podman-compose[121007]: 6b3e3ed8dd85f507a09a9f0b1047ea79f3e43ce1d718e5bfd974f238516fb48d
May 17 11:18:50 server.fedora podman-compose[120985]: exit code: 0
May 17 11:18:51 server.fedora podman[121014]: Error: no pod with name or ID pod_busybox found: no such pod
May 17 11:18:51 server.fedora systemd[891]: [email protected]: Control process exited, code=exited, status=125/n/a
May 17 11:18:51 server.fedora systemd[891]: [email protected]: Failed with result 'exit-code'.
May 17 11:18:51 server.fedora systemd[891]: Failed to start [email protected] - busybox rootless pod (podman-compose).
> podman pod stats 'pod_busybox'
Error: unable to get list of pods: no pod with name or ID pod_busybox found: no such pod

Environment:

  • OS: Fedora 38
  • podman version: 4.5.0
  • podman compose version: 1.0.6 (install using dnf)

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