Debian Jessie — A start job is running for LSB: Raise network interfaces

I came across this issue a couple of times now where after a reboot the Debian server would not come back up and totally locked me out from SSH’ing into it, all it gave me was the following text flashing over and over again:
“A start job is running for LSB: Raise network interfaces”
So totally locked out I have only 2 options take the easy quick fix route which is to detach the volume causing the conflict and attach a previous backup of a working snapshot or keep the sites offline and fix the issue permanently.
I will admit that I took the quick fix route the first time but once it happened again I decided that its best the site stay down until I got to the source of the problem.
So I dropped the server into rescue mode using my VPS providers rescue scripts and mounted the old servers directories to it and started to investigate.
As its a networking issue its pretty obvious to start looking in the /etc/networking/interfaces file — Im a Linux enthusiast and hobbyist so Im not sure that this is a rock solid solution either but it got my sites back up and running and I cant forsee any issues other than if my IP changes for some reason then I will have to reimplement.
The fix is basically to set a static IP so that the server doesn’t have to wait for the DHCP response.
Initially my interfaces file looked like this:
# interfaces(5) file used by ifup(8) and ifdown(8)
# The loopback network interface
auto lo
iface lo inet loopback# The primary network interface
auto eth0
iface eth0 inet dhcp# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
So after editing it and setting the static IP It now looks like the following:
# interfaces(5) file used by ifup(8) and ifdown(8)
# The loopback network interface
allow-hotplug lo
iface lo inet loopback# The primary network interface
iface eth0 inet static
address 52.24.121.220# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
Once you have done this save the file, reboot, remove the rescue script and restore the normal operational script and then try SSH into the server again.
Once you have gotten back in restart the Nginx/Apache service and any other services (Varnish etc) that may be necessary and reload your webpage and voila! it should be back up.
This is a known issue with Debian and for some reason I have not seen any solutions for it so hopefully this helps someone out if they come across it. It is mentioned on Stackoverflow here and here as well as in the official Debian Bug reports here although these examples are related to firewall’s etc which wasn’t the issue in my case, it was simply that systemd wouldn’t start until the networking was resolved at boot.
