Exemple de service et socket avec systemd

mkdir -p ~/.config/systemd/user && cd ~/.config/systemd/user

awx-proxy.socket

[Socket] ListenStream=127.0.0.1:8080 [Install] WantedBy=sockets.target

awx-proxy.service

[Unit] #Requires=container-httpd.service #After=container-httpd.service Requires=awx-proxy.socket After=awx-proxy.socket [Service] ExecStart=/home/k8s/.arkade/bin/kubectl port-forward svc/awx-service 3000:80
systemctl --user daemon-reload systemctl --user enable --now awx-proxy.socket

Test

curl -v -I 127.0.0.1:3000