Commit 189af617 authored by Michael Biebl's avatar Michael Biebl
Browse files

Various ifupdown integration fixes

- Use DefaultDependencies=no in ifup@.service so the service can be started
  as early as possible.
- Create the ifupdown runtime directory in ifup@.service as we can no longer
  rely on the networking service to do that for us.
- Don't stop ifup@.service on shutdown but let the networking service take
  care of stopping all hotplugged interfaces.
- Only start ifup@.service for interfaces configured as allow-hotplug.
parent 6f003a0a
......@@ -26,6 +26,14 @@ systemd (204-11) UNRELEASED; urgency=medium
While at it, add a Replaces: upstart. (Closes: #751589)
* Make the SysV compat tools try both /run/initctl and /dev/initctl. This
makes them usable under sysvinit as PID 1 without requiring any symlinks.
* Various ifupdown integration fixes
- Use DefaultDependencies=no in ifup@.service so the service can be
started as early as possible.
- Create the ifupdown runtime directory in ifup@.service as we can no
longer rely on the networking service to do that for us.
- Don't stop ifup@.service on shutdown but let the networking service take
care of stopping all hotplugged interfaces.
- Only start ifup@.service for interfaces configured as allow-hotplug.
[ Michael Stapelberg ]
* Clarify that systemd does not influence init whereas systemd-sysv does
......
......@@ -33,25 +33,23 @@ wait_for_interface() {
net_ifup() {
check_program /sbin/ifup
if grep -q '^auto[[:space:]].*\<'"$INTERFACE"'\>' \
/etc/network/interfaces; then
# this $INTERFACE is marked as "auto"
IFUPARG='\('$INTERFACE'\|-a\|--all\)'
else
IFUPARG=$INTERFACE
# exit if the interface is not configured as allow-hotplug
if ! ifquery --allow hotplug -l | grep -q "^${INTERFACE}\$"; then
exit 0
fi
if [ -d /run/systemd/system ]; then
exec systemctl start ifup@${INTERFACE}.service
fi
if ps -C ifup ho args | grep -q "$IFUPARG"; then
if ps -C ifup ho args | grep -q "$INTERFACE"; then
debug_mesg "Already ifup-ing interface $INTERFACE"
exit 0
exit 0
fi
wait_for_interface lo
if [ -d /run/systemd/system ]; then
exec systemctl start ifup@${INTERFACE}.service
else
exec ifup --allow=hotplug $INTERFACE
fi
exec ifup --allow=hotplug $INTERFACE
}
net_ifdown() {
......
[Unit]
Description=ifup for %I
After=local-fs.target
BindTo=sys-subsystem-net-devices-%i.device
Before=network.target
BindsTo=sys-subsystem-net-devices-%i.device
DefaultDependencies=no
[Service]
ExecStartPre=-/bin/mkdir -p /run/network
ExecStartPre=-/bin/chown root:netdev /run/network
ExecStart=/sbin/ifup --allow=hotplug %I
ExecStop=/sbin/ifdown %I
RemainAfterExit=true
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment