[SOLVED] - How do I prevent ifdown eth0 on shutdown on Ubuntu 18.04 LTS?


#1

I’ve one BareMetal C1 instance that was originally installed from the Ubuntu 14.04 LTS image, then upgraded to 16.04 LTS and now to 18.04 LTS.

I’ve a problem that it fails to reboot cleanly: systemd decides to stop ifup@eth0.service, which runs /sbin/ifdown eth0, which makes the nbd device mounted on / unreachable, causing all sorts of fun errors and timeouts – and I have to go to the cloud console and do a hard reboot.

I had this problem after an upgrade to 16.04 LTS and ‘systemctl mask networking’ fixed it.

Now the problem is back and I’m running out of ideas how to fix it. Things that do not work:

  • systemctl mask networking
  • adding ‘no-auto-down eth0’ to /etc/network/interfaces
  • adding ’ down false’ after ‘iface eth0 inet dhcp’ in /etc/network/interfaces

[ANSWERED] - Upgrading to ubuntu 17.04
#2

I may have a solution. I created a /etc/systemd/system/ifup@eth0.service.d/override.conf with the following in it:

[Service]
# root is on a network block device, never ever ever run ifupdown eth0
ExecStop=

and now sudo reboot works!


#3

and now sudo reboot works!

I’ll clarify: there are still some kernel errors during shutdown

[  OK  ] Stopped target [ 1476.091663] block nbd0: Receive control failed (result -512)
Basic System.
[[ 1476.175341] blk_update_request: I/O error, dev nbd0, sector 84312064
[ 1476.266301] Buffer I/O error on device nbd0, logical block 10539008
[ 1476.341492] blk_update_request: I/O error, dev nbd0, sector 196608
[ 1476.415635] Buffer I/O error on device nbd0, logical block 24576
...
[  OK  ] Stopped target [ 1476.091663] block nbd0: Receive control failed (result -512)
Basic System.
[[ 1476.175341] blk_update_request: I/O error, dev nbd0, sector 84312064
[ 1476.266301] Buffer I/O error on device nbd0, logical block 10539008
[ 1476.341492] blk_update_request: I/O error, dev nbd0, sector 196608
[ 1476.415635] Buffer I/O error on device nbd0, logical block 24576

including an oops inside ext4_commit_super, but systemd manages to reach “Starting Reboot…” and it actually does reboot (after a long scary pause), without me having to fiddle with the cloud console.