A systemd service to activate postgresql only when you need it
requires: Postgresql and Systemd
- create
postgresql.socket
into/usr/lib/systemd/system
- run
sudo systemctl enable postgresql.socket
to enable the socket service - Optional run
sudo systemctl start postgresql.socket
to use it this boot
- run
sudo systemctl disable postgresql.socket
to disable the socket service - run
sudo systemctl stop postgresql.socket
to stop the listening socket
- slow 1st time usage, may even fail 1st connection attempt
ListenStream
needs to point to where postgres would be, e.g. port5432
or a socket file. Config is for Arch Linux