Hello community, here is the log from the commit of package NetworkManager for openSUSE:Factory checked in at 2017-05-03 15:52:08 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/NetworkManager (Old) and /work/SRC/openSUSE:Factory/.NetworkManager.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "NetworkManager" Wed May 3 15:52:08 2017 rev:165 rq:489642 version:1.6.2 Changes: -------- --- /work/SRC/openSUSE:Factory/NetworkManager/NetworkManager.changes 2017-02-19 00:41:07.059700551 +0100 +++ /work/SRC/openSUSE:Factory/.NetworkManager.new/NetworkManager.changes 2017-05-03 15:52:09.434857017 +0200 @@ -1,0 +2,14 @@ +Wed Apr 19 21:33:23 UTC 2017 - [email protected] + +- Replace nfs NetworkManager dispatcher script. Issues of the old + nfs dispatcher script, fixed by this commit: + + It only mounts NFS shares with auto-mount. In SUSE's default + configuration, those are tried to be mounted at boot. + Unfortunately, this would not work, when NetworkManager + handles the connection later. The boot process stops at this + point. + + It unmounts everything on each "down" for any network + interface, even if the NFS share is still connected to the + computer via another network interface. + +------------------------------------------------------------------- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ nfs ++++++ --- /var/tmp/diff_new_pack.OD1VJQ/_old 2017-05-03 15:52:11.858514854 +0200 +++ /var/tmp/diff_new_pack.OD1VJQ/_new 2017-05-03 15:52:11.858514854 +0200 @@ -1,22 +1,83 @@ -#! /bin/sh +#! /bin/bash # # nfs - start NFS in response to interface change # -# Robert Love -# Bastian Holst <[email protected]> +# Bastian Senst <[email protected]> -case "$2" in - up|dhcp4-change|dhcp6-change) - # Check with systemd if nfs service is enabled - if /usr/bin/systemctl is-enabled nfs.service >/dev/null 2>&1; then - /bin/mount -alt nfs,nfs4 - fi - ;; - down) - /bin/umount -alt nfs,nfs4 - exit 0 - ;; - *) - exit 0 - ;; +function net_umount { + umount -l -f $1 &>/dev/null +} + +function net_mount { + mountpoint -q $1 || mount $1 +} + +function test_reach { + if [ "$(ip link show up $1)" = "" ]; then + return 1 + else + ping -n -c1 -w2 -I "$1" "$2" 2>&1 > /dev/null + fi +} + +DEVICE="$1" +COMMAND="$2" + +function test_other_reaches { + for other in $(ls /sys/class/net); do + if [[ "$other" != "$DEVICE" ]]; then + if test_reach "$other" "$1"; then + return 0 + fi + fi + done + return 1 +} + +declare -A reaches + +function other_reaches { + if [[ "${reaches[$1]-}" == "yes" ]]; then + return 0 + elif [[ "${reaches[$1]-}" == "no" ]]; then + return 1 + else + if test_other_reaches $1; then + reaches[$1]="yes" + return 0 + else + reaches[$1]="no" + return 1 + fi + fi +} + +NET_MOUNTS=$(sed -e '/^.*#/d' -e '/^.*:/!d' -e 's/\t/ /g' /etc/fstab | tr -s " ")$'\n'b + +case "$COMMAND" in + up|dhcp4-change|dhcp6-change) + # Check with systemd if nfs service is enabled + if /usr/bin/systemctl is-enabled nfs.service >/dev/null 2>&1; then + printf %s "$NET_MOUNTS" | while IFS= read -r line; do + MOUNT_POINT=$(echo $line | cut -f2 -d" ") + net_mount "$MOUNT_POINT" + done + fi + ;; + pre-down|down|vpn-pre-down) + printf %s "$NET_MOUNTS" | while IFS= read -r line; do + MOUNT_POINT=$(echo $line | cut -f2 -d" ") + HOST=$(echo $line | cut -f1 -d":") + if other_reaches $HOST; then + echo >&2 "Other network interfaces reach $HOST for $MOUNT_POINT." + else + net_umount "$MOUNT_POINT" + fi + done + exit 0 + ;; + *) + exit 0 + ;; esac +
