On two different servers I have redis and postgresdb installed. Neither will start successfully on boot, but will start if they are manually started/restarted. The error for both are the same (failure to bind to address). Here is an example of the postgres log:
2021-05-27 21:12:39.703 UTC [682] LOG: starting PostgreSQL 12.6 (Ubuntu 12.6-0ubuntu0.20.04.1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit
2021-05-27 21:12:39.704 UTC [682] LOG: listening on IPv4 address "127.0.0.1", port 5432
2021-05-27 21:12:39.707 UTC [682] LOG: could not bind IPv4 address "192.168.86.222": Cannot assign requested address
2021-05-27 21:12:39.707 UTC [682] HINT: Is another postmaster already running on port 5432? If not, wait a few seconds and retry.
and redis:
653:M 27 May 2021 21:12:23.090 # Could not create server TCP listening socket 192.168.86.234:6379: bind: Cannot assign requested address
the machines are running on separate hardware, but both running the same version of ubuntu (20.04.2 LTS). Those IP addresses are static for those machines, so nothing else is using them, and the fact I can find to them immediately after boot (when I restart the services) leads me to believe its not a case of the address actually being in use elsewhere. I'm not quite sure what the cause of the issue is. My best guess is that the services are trying to start before the networking service is completely up/configured, but I'm not sure how to verify or confirm this. Any ideas or suggestions?
You could try listing dependencies (using ufw as an example):
Or viewing the Unit File information (again for ufw):
If you really need the network to be up you can add to the Unit File:
You could also review the Journal to see if the services are spitting out any errors: