Skip to content

podman compose cannot operate fully rootless or without giving the user some sudo privileges #1421

@l-lopresto

Description

@l-lopresto

Describe the bug
I am trying to create a rootless environment so that users can do testing for when we run in prod, and i want to give to those users 0 sudo privleges.
But to create a unit and register it, since it defaults to /etc/systemd/user/ instead of using the local systemd folder (and provides no options to just write the file to a custom location), it is required to use sudo if the users wants to have a podman-compose stack that actually survives a reboot.

To Reproduce
Steps to reproduce the behavior:
podman-compose systemd -a create-unit

Expected behavior
It creates the systemd user unit under /home/$(whoami)/.config/systemd/user/default.target.wants/podman-compose@STACKNAME.service or at the very least it gives me the option to direct the output there

Actual behavior
WARNING:podman_compose:Could not write to [/etc/systemd/user/podman-compose@.service], use 'sudo'

Output

$ podman-compose version
podman compose version
>>>> Executing external compose provider "/usr/bin/podman-compose". Please see podman-compose(1) for how to disable this message. <<<<

podman-compose version 1.5.0
podman version 5.6.0


**Environment:**
Rocky Linux 10.1



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