Another one of those things that once you find out about them, immediately makes you wonder how you could have managed without it all those years: Systemd Socket Activations.
Daemon processes like the Docker daemon or CUPS are rarely needed, which is why I don’t have them started automatically on boot. But then almost all of the times when I try to access Docker (possibly from within the IDE) or try to print some document, I am briefly puzzled everytime, as to why it just won’t work. Until I remember that the service wasn’t started in the first place, fire up a quick terminal to start the service and go back to redo whatever it was I did before.
With Socket Activations a lightweigt socket is started that once bound to, will start up the actual service and pass through the socket. Docker at least on Arch Linux is set up like this out of-the-box but you have to enable it like so:
sudo systemctl stop docker.service sudo systemctl enable docker.socket sudo systemctl start docker.socket
We can now trigger the socket using
sudo docker ps and see if the service is started up again.