mgoltzsche / podman-static

static podman binaries and container image
Apache License 2.0
240 stars 59 forks source link

podman.service and podman.socket support #99

Open koh-osug opened 1 month ago

koh-osug commented 1 month ago

I'm using the podman Go API which is using sockets to communicate with podman.

Would it by OK to add the podman.socket file as /usr/lib/systemd/user/podman.socket:

[Unit]
Description=Podman API Socket
Documentation=man:podman-system-service(1)

[Socket]
ListenStream=%t/podman/podman.sock
SocketMode=0660

[Install]
WantedBy=sockets.target

And this in /usr/lib/systemd/user/podman.service:

[Unit]
Description=Podman API Service
Requires=podman.socket
After=podman.socket
Documentation=man:podman-system-service(1)
StartLimitIntervalSec=0

[Service]
Type=exec
KillMode=process
Environment=LOGGING="--log-level=info"
ExecStart=/usr/local/bin/podman $LOGGING system service

[Install]
WantedBy=default.target
mgoltzsche commented 1 month ago

Okay, now that the podman-restart.service is already there, let's have the other ones as well for convenience. Please feel free to create a PR.