ifupdown2 fails on boot under Ubuntu 16.04


I installed ifupdown2 under Ubuntu 16.04 and have problems to get it working on boot. It seems that systemd is stopping the networking unit directly after starting it.
# systemctl status networking
● networking.service - ifupdown2 init script
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
Drop-In: /run/systemd/generator/networking.service.d
└─50-insserv.conf-$network.conf
Active: inactive (dead) since Thu 2016-11-03 11:40:03 CET; 1min 9s ago
Process: 1481 ExecStop=/sbin/ifdown -a (code=exited, status=0/SUCCESS)
Process: 1374 ExecStart=/sbin/ifup -a (code=exited, status=0/SUCCESS)
Main PID: 1374 (code=exited, status=0/SUCCESS)

Nov 03 11:40:02 node1 systemd[1]: Starting ifupdown2 init script...
Nov 03 11:40:03 node1 systemd[1]: Started ifupdown2 init script.
If I run 'ifup -a' afterwards the interface comes up without any problem.

/etc/network/interfaces looks as follows:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eno1
iface eno1
address 192.168.100.10/24
gateway 192.168.100.1
Does anyone have an idea what is causing this behaviour?

5 replies

Userlevel 4
This is a known issue (CM-13071) we're still investigating it at the moment.
Userlevel 3
Our networking script expects to be RemainAfterExit=yes, and Type=oneshot with systemd, so it runs, exits and is still consider active. I believe that is a different issue than
CM-13071. ifupdown2 should be installing a networking.service unit file. Can you check with dpkg -L ifupdown2 to see if your install has that? If it does, this may be the systemd issue when you have both an init.d/networking and a systemd unit file. What does 'systemctl cat networking.service' show?

Dave Olson wrote:

Our networking script expects to be RemainAfterExit=yes, and Type=oneshot with systemd, so it run...

Dave, you are right. I just tried to reproduce it and
Adding "RemainAfterExit=yes" under [Service] in /lib/systemd/system/networking.service helped.

This has been fixed in later ifupdown2 version uploaded to debian. It probably did not make it into ubuntu. I will follow up.
Dave Olson wrote:

Our networking script expects to be RemainAfterExit=yes, and Type=oneshot with systemd, so it run...

Adding "RemainAfterExit=yes" fixes it for me, too. Thank you!

Userlevel 4
Dave Olson wrote:

Our networking script expects to be RemainAfterExit=yes, and Type=oneshot with systemd, so it run...

I correct it on my machine with the following SED line... (adding it here so I can find it later): sed -i '/\[Service\]/a RemainAfterExit=yes' /lib/systemd/system/networking.service

Reply