diff -Nru systemd-219/debian/changelog systemd-219/debian/changelog --- systemd-219/debian/changelog 2015-03-17 23:43:45.000000000 +0000 +++ systemd-219/debian/changelog 2015-03-19 15:43:15.000000000 +0000 @@ -1,3 +1,13 @@ +systemd (219-4ubuntu7) vivid; urgency=medium + + * use systemd-ifupdown-helper script to handle ifup and ifdown + of auto or hotplug devices. This allows iscsi root volumes + to work again. (LP: #1432829) + * debian/control/tests: disable running of upstart tests until + upstart packaging bug 1422681 is resolved. + + -- Scott Moser Thu, 19 Mar 2015 11:43:14 -0400 + systemd (219-4ubuntu6) vivid; urgency=medium * d/extra/units/ifup@.service, d/extra/tmpfiles.d/debian.conf: diff -Nru systemd-219/debian/extra/systemd-ifupdown-helper systemd-219/debian/extra/systemd-ifupdown-helper --- systemd-219/debian/extra/systemd-ifupdown-helper 1970-01-01 00:00:00.000000000 +0000 +++ systemd-219/debian/extra/systemd-ifupdown-helper 2015-03-19 12:43:38.000000000 +0000 @@ -0,0 +1,83 @@ +#!/bin/sh + +CR=" +" +IFSTATE_FILE="/run/network/ifstate" + +do_ifup() { + local ifname="$1" + ifquery --list --allow=hotplug | grep -q "^$ifname$" || + ifquery --list --allow=auto | grep -q "^$ifname$" || + return 0 + ifup "$ifname" +} + +is_persistent_initramfs_iface() { + # open-iscsi.interface is written by open-iscsi when booting from + # an iscsi volume, when you can't bounce the interface that the root + # device is on. The other file, is meant as a more generic location + # for an initramfs job to write "persistent" network devices. + grep -qs "^$1$" /run/initramfs/open-iscsi.interface \ + "/run/network/initramfs-persistent-iface" +} + +adjust_resolvconf() { + local ifname="$1" data="" + command -v resolvconf >/dev/null 2>&1 || return 0 + + # /run/net-eth0.conf is written by 'ipconfig' in klibc + [ -f "/run/net-$ifname.conf" ] || return 0 + . "/run/net-$ifname.conf" + data="" + [ -n "$DOMAINSEARCH" ] && data="$data${CR}domainsearch $DOMAINSEARCH" + for ns in "$IPV4DNS0" "$IPV4DNS1"; do + [ -n "$ns" -a "$ns" != "0.0.0.0" ] && data="$data${CR}nameserver $ns" + done + data=${data#${CR}} + [ -z "$data" ] && return 0 + echo "$data" | resolvconf -a "$ifname.initramfs" +} + +do_ifup_persistent() { + local ifname="$1" + # already done + grep -qs "$ifname=" $IFSTATE_FILE && return 0 + + adjust_resolvconf "$ifname" || return + # write to the ifstate file, so ifupdown thinks its up. + echo "$ifname=$ifname" >> $IFSTATE_FILE +} + +start_main() { + local ifname=$1 + shift + if is_persistent_initramfs_iface "$ifname"; then + do_ifup_persistent "$ifname" "$@" || return + fi + do_ifup "$ifname" "$@" +} + +stop_main() { + local ifname="$1" fail=0 + shift + if ! is_persistent_initramfs_iface "$ifname"; then + /sbin/ifdown "$ifname" + return + fi + # we only pretend to bring the interface down + # if interface is not present, we're already done + grep -qs "^$ifname=" $IFSTATE_FILE || return 0 + + sed -i "/^$ifname=/d" "$IFSTATE_FILE" || fail=1 + resolvconf -d "$ifname.initramfs" || fail=1 + return $fail +} + +mode="$1" +shift; +case "$mode" in + start) start_main "$@";; + stop) stop_main "$@";; + *) echo "$0: unknown mode '$mode'" 1>&2; exit 1;; +esac +exit diff -Nru systemd-219/debian/extra/units/ifup@.service systemd-219/debian/extra/units/ifup@.service --- systemd-219/debian/extra/units/ifup@.service 2015-03-17 23:43:45.000000000 +0000 +++ systemd-219/debian/extra/units/ifup@.service 2015-03-19 00:31:26.000000000 +0000 @@ -7,9 +7,6 @@ [Service] Type=oneshot -ExecStart=/sbin/ifup --allow=hotplug %I -ExecStartPost=/sbin/ifup --allow=auto %I -# only fail if ifupdown knows about the iface AND it's not up -ExecStartPost=/bin/sh -c 'if ifquery %I >/dev/null; then ifquery --state %I >/dev/null; fi' -ExecStop=/sbin/ifdown %I +ExecStart=/lib/systemd/systemd-ifupdown-helper start %I +ExecStop=/lib/systemd/systemd-ifupdown-helper stop %I RemainAfterExit=true diff -Nru systemd-219/debian/systemd.install systemd-219/debian/systemd.install --- systemd-219/debian/systemd.install 2015-03-17 23:43:45.000000000 +0000 +++ systemd-219/debian/systemd.install 2015-03-19 00:31:26.000000000 +0000 @@ -53,3 +53,4 @@ ../../extra/tmpfiles.d/*.conf usr/lib/tmpfiles.d/ ../../extra/debian-fixup lib/systemd/ ../../extra/units/* lib/systemd/system/ +../../extra/systemd-ifupdown-helper lib/systemd/ diff -Nru systemd-219/debian/tests/control systemd-219/debian/tests/control --- systemd-219/debian/tests/control 2015-03-17 23:43:45.000000000 +0000 +++ systemd-219/debian/tests/control 2015-03-19 15:42:30.000000000 +0000 @@ -22,6 +22,7 @@ Restrictions: needs-root, isolation-machine, needs-recommends, breaks-testbed Tests: cmdline-upstart-boot +Disabled-until-bug-fixed: http://pad.lv/1422681 Depends: systemd-sysv, cron, network-manager, python3 Restrictions: needs-root, isolation-machine, breaks-testbed