Skip to content

add systemd service files #307

Open
Open
@tinywrkb

Description

@tinywrkb

It would be great if podman-compose could be shipped with systems services files.

I'm attaching my systemd service files. They are pretty basic, probably need to be improved so I'm not adding these myself in a PR, but they are working for me.

/usr/lib/systemd/system/[email protected]

[Unit]
Description=%i rootful pod (podman-compose)
After=network-online.target
Wants=network-online.target

[Service]
Type=oneshot
RemainAfterExit=true
WorkingDirectory=/etc/containers/compose/%i
ExecStart=/usr/bin/podman-compose up -d --remove-orphans
ExecStop=/usr/bin/podman-compose down

[Install]
WantedBy=multi-user.target

/usr/lib/systemd/user/[email protected]

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

[Service]
Type=oneshot
RemainAfterExit=true
WorkingDirectory=%h/.config/containers/compose/%i
ExecStart=/usr/bin/podman-compose up -d --remove-orphans
ExecStop=/usr/bin/podman-compose down

[Install]
WantedBy=default.target

Previously I was using environment file in /etc/conf.d to set the compose file, but now that podman-compose defaults prioritize compose.yaml and compose.yml, I don't see a reason why we need this configurable.

If it's not obvious, each pod should have a folder in /etc/containers/compose/ and (edit:) or ~/.config/containers/compose/.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions