containers / containers/podman-compose
podman compose cannot operate fully rootless or without giving the user some sudo privileges
- Dominant language
- Python
- Stars
- 6.2k
- Forks
- 622
- PR merge metrics
- No merged PRs in 30d
Description
**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
Contributor guide
Research direction
Run `podman-compose systemd -a create-unit` in the reported rootless environment and inspect how it handles `/etc/systemd/user/podman-compose@.service`. Compare this with the requested `/home/$(whoami)/.config/systemd/user/default.target.wants/podman-compose@STACKNAME.service` location. Done means a rootless user can create a persistent unit without sudo, or can direct the output to a custom location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- linux, python
- Domain
- devops, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 54/100