Open Rothammel opened 1 year ago
rough untested(!) draft:
podman
/etc/systemd/system/systemctl-mqtt-podman-container.service
with following content:
[Unit]
After=dbus.socket
Requires=dbus.socket
[Service]
Type=notify
NotifyAccess=all
ExecStartPre=/usr/sbin/apparmor_parser /somewhere/docker-apparmor-profile
ExecStart=/usr/bin/podman run --cidfile %t/%n.ctr-id \
--rm --detach --sdnotify conmon --log-driver journald \
--name systemctl_mqtt \
-v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:rw \
--hostname %H --userns host --user 0 \
--security-opt no-new-privileges --security-opt apparmor=systemctl-mqtt \
docker.io/fphammerle/systemctl-mqtt:0.5.0-amd64@sha256:34dcb878dbd66315de6fbf97ceb29e8fec549b7269c6c828c4c889a54a091f14 \
systemctl-mqtt ...
ExecStop=/usr/bin/podman stop --cidfile %t/%n.ctr-id
ExecStopPost=/usr/bin/podman rm --cidfile %t/%n.ctr-id
ExecStopPost=rm %t/%n.ctr-id
[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable systemctl-mqtt-podman-container.service
sudo systemctl start systemctl-mqtt-podman-container.service
how can I perform an autostart via systemd