diff -Nru multipath-tools-0.6.4/debian/changelog multipath-tools-0.6.4/debian/changelog --- multipath-tools-0.6.4/debian/changelog 2017-03-28 20:20:22.000000000 -0500 +++ multipath-tools-0.6.4/debian/changelog 2017-03-30 11:44:18.000000000 -0500 @@ -1,3 +1,10 @@ +multipath-tools (0.6.4-3ubuntu3waitsocket1) UNRELEASED; urgency=medium + + * debian/initramfs/local-bottom: wait for the multipathd unix socket + to close, so to avoid multipathd.socket unit failure. (LP: #1670811) + + -- Mauricio Faria de Oliveira Thu, 30 Mar 2017 13:44:18 -0300 + multipath-tools (0.6.4-3ubuntu3) zesty; urgency=medium * debian/initramfs/hooks, debian/initramfs/local-bottom: diff -Nru multipath-tools-0.6.4/debian/initramfs/local-bottom multipath-tools-0.6.4/debian/initramfs/local-bottom --- multipath-tools-0.6.4/debian/initramfs/local-bottom 2017-03-28 20:17:23.000000000 -0500 +++ multipath-tools-0.6.4/debian/initramfs/local-bottom 2017-03-30 11:43:01.000000000 -0500 @@ -43,6 +43,19 @@ verbose && log_failure_msg "inconsistent PIDs (pidof: '${pid_pidof}', multipathd.pid: '${pid_file}')" fi +# Wait for multipathd unix socket to close. +# It might take a while for multipathd to handle the signal, +# which might leave the unix socket open until the upcoming +# systemd multipath.socket unit starts. Then it fails with +# (Result: resources) like this (logs in journalctl): +# "Failed to listen on sockets: Address already in use" +seconds=10 +while [ $seconds -gt 0 ]; do + grep -q '@/org/kernel/linux/storage/multipathd' /proc/net/unix || break + seconds=$((seconds - 1)) + sleep 1 +done + maybe_break post-multipath exit 0