centossystemddbuspodman

D-Bus and Systemd Issues with Podman on CentOS Stream 9


I am using Podman version 4.8.1 on CentOS Stream 9 as a non-root user "apideployer". I encounter an error when trying to load systemd user services with "systemctl --user daemon-reload", receiving "Failed to connect to bus: No medium found". This seems to be related to D-Bus access within my SSH session.

I attempted to transition to Quadlet files for better container management, but I'm encountering issues with the systemd integration. I expected systemd to generate .service files from the Quadlet files, but this isn’t happening. I have placed the .container file at $HOME/.config/containers/systemd/

I have been reviewing:

This is one of my Quadlet files for testing purposes. The oracle-db.container:

[Unit]
Description=Oracle Database Container
After=network.target

[Container]
Name=oracle-db
Image=container-registry.oracle.com/database/express:latest
Environment=ORACLE_PWD=mysecurepassword
Ports=1521:1521
Volume= oracle-db.volume:/opt/oracle/oradata
Network=oracle-db.network
IP=192.168.100.10

[Service]
# Restart service when sleep finishes
Restart=always
# Extend Timeout to allow time to pull the image
TimeoutStartSec=900

[Install]
# Start by default on boot
WantedBy=multi-user.target default.target

Solution

  • I expected systemd to generate .service files from the Quadlet files, but this isn’t happening.

    Note that generators only run at boot time and after running systemctl daemon-reload. You will find the generated unit files in /run/systemd/generator. They will run automatically at boot, or you can explicitly systemctl start the generated service.

    If it looks like the unit files aren't getting generated, you can manually run the generator:

    mkdir /tmp/units
    /usr/lib/systemd/system-generators/podman-system-generator -v -no-kmsg-log /tmp/units
    

    This will output some information about the generation process. E.g., on my system, the above produces:

    quadlet-generator[270888]: Starting quadlet-generator, output to: /tmp/units
    quadlet-generator[270888]: Loading source unit file /etc/containers/systemd/devpi.container
    quadlet-generator[270888]: Loading source unit file /etc/containers/systemd/devpi.volume
    quadlet-generator[270888]: Loading source unit file /etc/containers/systemd/services.network
    quadlet-generator[270888]: Loading source unit file /etc/containers/systemd/traefik.container
    quadlet-generator[270888]: Loading source unit file /etc/containers/systemd/whoami.container
    quadlet-generator[270888]: writing "/tmp/units/devpi-volume.service"
    quadlet-generator[270888]: writing "/tmp/units/services-network.service"
    quadlet-generator[270888]: writing "/tmp/units/devpi.service"
    quadlet-generator[270888]: Creating symlink /tmp/units/default.target.wants/devpi.service -> ../devpi.service
    quadlet-generator[270888]: writing "/tmp/units/traefik.service"
    quadlet-generator[270888]: Creating symlink /tmp/units/default.target.wants/traefik.service -> ../traefik.service
    quadlet-generator[270888]: writing "/tmp/units/whoami.service"
    quadlet-generator[270888]: Creating symlink /tmp/units/default.target.wants/whoami.service -> ../whoami.service
    

    This should let you know if there are any errors in your quadlet files.