Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Error] overridden systemd units in /etc/systemd/system can cause startup failure #641

Closed
brimston3 opened this issue Mar 1, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@brimston3
Copy link

Describe the bug
Containers with systemctl fail to start if an override systemd unit file exists in /etc/systemd/system that is not zero-length for any unit file that is typically masked by distrobox.

To Reproduce

distrobox create -i docker.io/library/archlinux --init -n vm-arch
distrobox enter vm-arch
sudo systemctl unmask dbus.service
sudo cp /usr/lib/systemd/system/dbus.service /etc/systemd/system/
sudo shutdown
distrobox enter vm-arch

At this point the container will not start and cannot be entered to fix.

Expected behavior
Container starts and gets to a prompt. The pre-existing service unit in /etc/systemd/system/unit.service is not masked or overwritten.

Logs
distrobox-enter-sysd-mask.log
podman-logs-sysd-mask.log

Desktop (please complete the following information):

  • Are you using podman or docker? podman
  • Which version or podman or docker? podman 4.2.1
  • Which version of distrobox? 1.4.2.1

Additional context

@brimston3 brimston3 added the bug Something isn't working label Mar 1, 2023
@brimston3
Copy link
Author

It's probably safe to ignore errors when performing systemctl mask "$(basename "${unit}")". The other option is to check for existence of /etc/systemd/system/"$(basename "${unit}")" before trying to mask.

89luca89 added a commit that referenced this issue Jun 10, 2023
Signed-off-by: Luca Di Maio <luca.dimaio1@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant