Hello community, here is the log from the commit of package sysconfig for openSUSE:Factory checked in at Mon Sep 26 17:07:40 CEST 2011.
-------- --- sysconfig/sysconfig.changes 2011-09-08 17:11:00.000000000 +0200 +++ /mounts/work_src_done/STABLE/sysconfig/sysconfig.changes 2011-09-26 14:37:55.000000000 +0200 @@ -1,0 +2,15 @@ +Mon Sep 26 12:36:27 UTC 2011 - [email protected] + +- Fixed inverted link ready return value test + +------------------------------------------------------------------ +Mon Sep 26 10:09:23 UTC 2011 - [email protected] + +- version 0.75.3 +- Handle changing between ifup and NM with systemd and fixed + to enable boot flags in /etc/init.d/network while booting + under systemd (bnc#719214). +- Wait/check until the end of ipv6 duplicate address detection + to not cause failures of following services (bnc#697929). + +------------------------------------------------------------------ calling whatdependson for head-i586 Old: ---- sysconfig-0.75.2.tar.bz2 New: ---- 0001-inverted-link-ready-return-value-test.patch sysconfig-0.75.3.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ sysconfig.spec ++++++ --- /var/tmp/diff_new_pack.II1Yoo/_old 2011-09-26 17:07:11.000000000 +0200 +++ /var/tmp/diff_new_pack.II1Yoo/_new 2011-09-26 17:07:11.000000000 +0200 @@ -19,7 +19,7 @@ Name: sysconfig -Version: 0.75.2 +Version: 0.75.3 Release: 1 Summary: The sysconfig scheme and traditional network scripts Url: http://gitorious.org/opensuse/sysconfig @@ -32,6 +32,7 @@ Requires: iproute2 dbus-1 procps BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: %name-%version.tar.bz2 +Patch1: 0001-inverted-link-ready-return-value-test.patch %description This package provides the SuSE system configuration scheme and @@ -51,6 +52,7 @@ %prep %setup -n sysconfig-%{version} +%patch1 -p1 %build autoreconf --force --install ++++++ 0001-inverted-link-ready-return-value-test.patch ++++++ >From 8fed34d78851f6fba1c6451e74cba6c9772b157e Mon Sep 17 00:00:00 2001 From: Marius Tomaschewski <[email protected]> Date: Mon, 26 Sep 2011 14:32:25 +0200 Subject: [PATCH] Fixed inverted link ready return value test Signed-off-by: Marius Tomaschewski <[email protected]> --- scripts/ifup | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/ifup b/scripts/ifup index 08ea71a..ba1e4f5 100755 --- a/scripts/ifup +++ b/scripts/ifup @@ -1162,11 +1162,11 @@ case "$BOOTPROTO$SKIP_MAIN_PART" in if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then link_ready_check "$INTERFACE" link_ret=$? - test "$link_ret" && retcode=$R_DHCP_BG + test "$link_ret" -eq 0 || retcode=$R_DHCP_BG else link_ready_wait "$INTERFACE" "${LINK_READY_WAIT}" link_ret=$? - test "$link_ret" && retcode=$R_NOTRUNNING + test "$link_ret" -eq 0 || retcode=$R_NOTRUNNING fi fi fi @@ -1241,9 +1241,9 @@ case "$BOOTPROTO$SKIP_MAIN_PART" in link_ready_check "$INTERFACE" link_ret=$? if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then - test "$link_ret" && retcode=$R_DHCP_BG + test "$link_ret" -eq 0 || retcode=$R_DHCP_BG else - test "$link_ret" && retcode=$R_NOTRUNNING + test "$link_ret" -eq 0 || retcode=$R_NOTRUNNING fi fi -- 1.7.3.4 ++++++ sysconfig-0.75.2.tar.bz2 -> sysconfig-0.75.3.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/ChangeLog new/sysconfig-0.75.3/ChangeLog --- old/sysconfig-0.75.2/ChangeLog 2011-09-08 16:00:31.000000000 +0200 +++ new/sysconfig-0.75.3/ChangeLog 2011-09-26 12:40:36.000000000 +0200 @@ -1,4 +1,69 @@ -commit 02a7c96312bda2eca5b518c93dc70d2ffb1a81fb (HEAD, master) +commit 1445822f75850654a42235e06a61d6ba9de5bcde (HEAD, master) +Author: Marius Tomaschewski <[email protected]> +Date: Mon Sep 26 12:39:42 2011 +0200 + + version 0.75.3, updated changes file + +commit 227012e7e99466fce71d03919fbccd52028025f6 +Author: Marius Tomaschewski <[email protected]> +Date: Mon Sep 26 11:33:20 2011 +0200 + + Fixed wait for ipv6 duplicate address detection + + Improved to not wait for link ready by default, because this breaks + the status of several interfaces (e.g. host-only bridges) and check + the ipv6 duplicate address detection only. IPv6 dad starts when the + link becomes up & ready, so this includes the link ready status. + The link ready check can be enabled on a per interface basis. + Fixed to not wait for each single interface separately in ifup, but + to wait for all together in /etc/init.d/network instead (bnc#697929). + +commit 19b9f399ca905d99cefd6e7fabd417a083521f7c +Author: Marius Tomaschewski <[email protected]> +Date: Fri Sep 16 15:07:10 2011 +0200 + + Wait for link and ipv6 duplicate address detection + + Fixed to wait until link becomes ready and ipv6 duplicate address + detection finished what can cause failures of further services. + Added LINK_READY_WAIT and IPV6_DAD_WAIT variables (bnc#697929). + +commit 21c4b70cf6204b3bac37d0ef70a159724b1af51a (public/master, origin/master) +Author: Marius Tomaschewski <[email protected]> +Date: Thu Sep 22 20:58:23 2011 +0200 + + Fixed last change to NM under systemd redirection + + Reverted to use ./$0 trick again, so the calls aren't + redirected back to systemd by rc.status. + +commit 96b53f569b3645b06fc5c89266e611e931ab423d +Author: Marius Tomaschewski <[email protected]> +Date: Thu Sep 22 19:48:52 2011 +0200 + + Moved NM redirection outside localfs case + + The /etc/init.d/network handles just the localfs case and + never NM as NM is installed under /usr and is handled by + /etc/init.d/network-remotefs or NetworkManager.service. + In a running service, we redirects e.g. network restart + to the NetworkManager.service under systemd (bnc#719214). + +commit 8766434691bb2c14f9d58dedb1b3c7b7bebe0d5f +Author: Marius Tomaschewski <[email protected]> +Date: Thu Sep 22 19:45:58 2011 +0200 + + Fixed to apply localfs filter also under systemd + +commit 69654500937ecf027041a579b84c680e8fdf11b7 +Author: Frederic Crozat <[email protected]> +Date: Wed Sep 21 18:10:50 2011 +0200 + + Handle reload / restart when changing between ifup and NM with systemd + + Need to restart NM ourself, using systemd (bnc#719214) + +commit 02a7c96312bda2eca5b518c93dc70d2ffb1a81fb (export/master) Author: Marius Tomaschewski <[email protected]> Date: Thu Sep 8 15:59:03 2011 +0200 @@ -25,7 +90,7 @@ is showed when only remotefs has been stopped. Stopping localfs, stops remotefs when it is started as well. -commit 42adafa3d1e6a30f9278470c2f66d966782a662f (tag: version-0.75.1, origin/master, export/master) +commit 42adafa3d1e6a30f9278470c2f66d966782a662f (tag: version-0.75.1) Author: Marius Tomaschewski <[email protected]> Date: Mon Sep 5 15:46:58 2011 +0200 @@ -93,7 +158,7 @@ Added ibft,node to the meta list, not only comment -commit ea6e6c62fdba32ff0f1157f50deb1f710df70e58 (backup/master) +commit ea6e6c62fdba32ff0f1157f50deb1f710df70e58 Author: Marius Tomaschewski <[email protected]> Date: Mon Jun 27 09:39:49 2011 +0200 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/VERSION new/sysconfig-0.75.3/VERSION --- old/sysconfig-0.75.2/VERSION 2011-09-08 15:58:31.000000000 +0200 +++ new/sysconfig-0.75.3/VERSION 2011-09-26 12:10:01.000000000 +0200 @@ -1 +1 @@ -0.75.2 +0.75.3 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/config/ifcfg.template new/sysconfig-0.75.3/config/ifcfg.template --- old/sysconfig-0.75.2/config/ifcfg.template 2011-09-05 10:27:48.000000000 +0200 +++ new/sysconfig-0.75.3/config/ifcfg.template 2011-09-26 12:03:18.000000000 +0200 @@ -171,6 +171,28 @@ # LINK_OPTIONS= +## Type: integer +## Default: 0 +# +# The number of seconds to wait for link to become useable / ready. +# Default is 0, causing to not wait for a ready link (0), because link +# detection can't be enabled in all cases (e.g. bridges without ports). +# Please use per interface settings to enable it. +# +LINK_READY_WAIT= + +## Type: integer +## Default: "" +# +# The number of seconds to wait for the end of IPv6 duplicate address +# detection in ifup. +# Default is to use WAIT_FOR_INTERFACES/2 seconds in normal ifup runs. +# When ifup is called by /etc/init.d/network at boot time, the check +# is done, but /etc/init.d/network waits WAIT_FOR_INTERFACES seconds +# for all interfaces togerther. Set to 0 to disable it. +# +IPV6_DAD_WAIT= + ## Type: string ## Default: "" # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/config/sysconfig.config-network new/sysconfig-0.75.3/config/sysconfig.config-network --- old/sysconfig-0.75.2/config/sysconfig.config-network 2011-06-10 14:57:10.000000000 +0200 +++ new/sysconfig-0.75.3/config/sysconfig.config-network 2011-09-26 12:03:18.000000000 +0200 @@ -143,6 +143,28 @@ # WAIT_FOR_INTERFACES="30" +## Type: integer +## Default: 0 +# +# The number of seconds to wait for link to become useable / ready. +# Default is 0, causing to not wait for a ready link (0), because link +# detection can't be enabled in all cases (e.g. bridges without ports). +# Please use per interface settings to enable it. +# +LINK_READY_WAIT=0 + +## Type: integer +## Default: "" +# +# The number of seconds to wait for the end of IPv6 duplicate address +# detection in ifup. +# Default is to use WAIT_FOR_INTERFACES/2 seconds in normal ifup runs. +# When ifup is called by /etc/init.d/network at boot time, the check +# is done, but /etc/init.d/network waits WAIT_FOR_INTERFACES seconds +# for all interfaces togerther. Set to 0 to disable it. +# +IPV6_DAD_WAIT="" + ## Type: yesno ## Default: yes # diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/configure new/sysconfig-0.75.3/configure --- old/sysconfig-0.75.2/configure 2011-09-08 15:59:57.000000000 +0200 +++ new/sysconfig-0.75.3/configure 2011-09-26 12:40:16.000000000 +0200 @@ -1,7 +1,7 @@ #! /bin/sh # From configure.in Revision: 1.13 . # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68 for sysconfig 0.75.2. +# Generated by GNU Autoconf 2.68 for sysconfig 0.75.3. # # Report bugs to <http://www.suse.de/feedback/>. # @@ -710,8 +710,8 @@ # Identity of this package. PACKAGE_NAME='sysconfig' PACKAGE_TARNAME='sysconfig' -PACKAGE_VERSION='0.75.2' -PACKAGE_STRING='sysconfig 0.75.2' +PACKAGE_VERSION='0.75.3' +PACKAGE_STRING='sysconfig 0.75.3' PACKAGE_BUGREPORT='http://www.suse.de/feedback/' PACKAGE_URL='' @@ -1437,7 +1437,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sysconfig 0.75.2 to adapt to many kinds of systems. +\`configure' configures sysconfig 0.75.3 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1507,7 +1507,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sysconfig 0.75.2:";; + short | recursive ) echo "Configuration of sysconfig 0.75.3:";; esac cat <<\_ACEOF @@ -1607,7 +1607,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sysconfig configure 0.75.2 +sysconfig configure 0.75.3 generated by GNU Autoconf 2.68 Copyright (C) 2010 Free Software Foundation, Inc. @@ -1976,7 +1976,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sysconfig $as_me 0.75.2, which was +It was created by sysconfig $as_me 0.75.3, which was generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2795,7 +2795,7 @@ # Define the identity of the package. PACKAGE='sysconfig' - VERSION='0.75.2' + VERSION='0.75.3' cat >>confdefs.h <<_ACEOF @@ -11296,7 +11296,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sysconfig $as_me 0.75.2, which was +This file was extended by sysconfig $as_me 0.75.3, which was generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -11353,7 +11353,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sysconfig config.status 0.75.2 +sysconfig config.status 0.75.3 configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/scripts/functions new/sysconfig-0.75.3/scripts/functions --- old/sysconfig-0.75.2/scripts/functions 2011-09-08 15:56:00.000000000 +0200 +++ new/sysconfig-0.75.3/scripts/functions 2011-09-26 12:03:18.000000000 +0200 @@ -110,6 +110,86 @@ esac } +link_ready_check () { + local c=`cat /sys/class/net/${1}/carrier 2>/dev/null` + local d=`cat /sys/class/net/${1}/dormant 2>/dev/null` + local o=`cat /sys/class/net/${1}/operstate 2>/dev/null` + + #debug "link ready ${1}: carrier=$c, dormant=$d, operstate=$o" + if test -e "/sys/class/net/${1}/operstate" ; then + # SLE 11 has carrier + operstate + dormant + test "$d" = "0" || return 3 + test "$c" = "1" || return 2 + test \( "$o" = "up" -o "$o" = "unknown" \) || return 1 + else + # e.g. SLE 10 does not have operstate/dormant + test "$c" = "1" || return 1 + fi + return 0 +} + +ipv6_addr_dad_check() +{ + local iface="$1" word i + local nodad=1 tentative=1 dadfailed=1 + test -f "/sys/class/net/$iface/ifindex" || return 1 + while read -a word ; do + test "${word[0]}" != "inet6" && continue + for((i=2; i<${#word[@]}; ++i)) ; do + case ${word[$i]} in + nodad) nodad=0 ;; + tentative) tentative=0 ;; + dadfailed) dadfailed=0 ;; + flags) ((i++)) + rx='^[[:xdigit:]]+$' + [[ "${word[$i]}" =~ $rx ]] || continue + hx="0x${word[$i]}" + test $(( $hx & 0x02 )) -ne 0 && nodad=0 + test $(( $hx & 0x08 )) -ne 0 && dadfailed=0 + test $(( $hx & 0x40 )) -ne 0 && tentative=0 + ;; + esac + done + #debug "ipv6 dad $iface: nodad=$nodad, dadfailed=$dadfailed, tentative=$tentative" + test $nodad -eq 0 && continue + test $dadfailed -eq 0 && return 2 + test $tentative -eq 0 && return 3 + done < <(LC_ALL=C ip -6 addr show ${iface:+dev "$iface"} 2>/dev/null) + return $R_SUCCESS +} + +link_ready_wait () +{ + local iface=$1 + local -i wsecs=${2:-0} + local -i uwait=25000 + local -i loops=$(((wsecs * 100000) / $uwait)) + local -i loop=0 ret=0 + + link_ready_check "$iface" ; ret=$? + while ((ret != 0 && loop++ < loops)) ; do + usleep $uwait + link_ready_check "$iface" ; ret=$? + done + return $ret +} + +ipv6_addr_dad_wait() +{ + local iface=$1 + local -i wsecs=${2:-0} + local -i uwait=25000 + local -i loops=$(((wsecs * 100000) / $uwait)) + local -i loop=0 ret=0 + + ipv6_addr_dad_check "$iface" ; ret=$? + while ((ret == 3 && loop++ < loops)) ; do + usleep $uwait + ipv6_addr_dad_check "$iface" ; ret=$? + done + return $ret +} + get_ethtool_drv_info () { test -n "$1" || return 1 local ethtool="/sbin/ethtool" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/scripts/ifup new/sysconfig-0.75.3/scripts/ifup --- old/sysconfig-0.75.2/scripts/ifup 2011-09-08 15:56:00.000000000 +0200 +++ new/sysconfig-0.75.3/scripts/ifup 2011-09-26 12:03:18.000000000 +0200 @@ -96,6 +96,7 @@ OPTIONS=$@ MODE=manual HOTPLUG=no +BOOTING=no CONTROL_IFPLUGD=yes # Start/Stop ifplugd? # Don't log messages from ifstatus in syslog by default (Bug 261350). This # overwrites the config variable /etc/sysconfig/network/config:USE_SYSLOG @@ -103,7 +104,7 @@ test "$SCRIPTNAME" == ifstatus && DONT_USE_SYSLOG=yes while [ $# -gt 0 ]; do case $1 in - boot|onboot) MODE=auto ;; + boot|onboot) MODE=auto ; BOOTING=yes ;; auto) MODE=auto ;; hotplug) MODE=auto HOTPLUG=yes ;; @@ -445,7 +446,7 @@ esac commit_cached_config_data $INTERFACE commit_cached_config_data $INTERFACE PFX=ifup- - ;; + ;; ifdown) test "$HOTPLUG" = yes && RET_STATE=removed test "$RUN_FROM_RC" = yes && RET_STATE=removed @@ -469,7 +470,7 @@ commit_cached_config_data $INTERFACE delete_from_cached_config_data '*' '' $INTERFACE PFX=ifup- commit_cached_config_data $INTERFACE PFX=ifup- - ;; + ;; esac } @@ -523,6 +524,11 @@ if [ -n "$VENDORID$PRODUCTID" -a "$BUSNAME" = pci -a -x /sbin/lspci ] ; then DEVNAME=`lspci -d $VENDORID:$PRODUCTID 2>/dev/null | sed -n 1p` DEVNAME=${DEVNAME#*: } + if [ "$RUN_FROM_RC" = yes ] ; then + DEVNAME=${DEVNAME%%[(\[]*} + DEVNAME=${DEVNAME:0:45} + NAME=${NAME:0:45} + fi elif [ "$BUSNAME" = pcmcia ] ; then DEVNAME=`cat /sys/class/net/$INTERFACE/device/prod_id* 2>/dev/null` fi @@ -978,11 +984,8 @@ ;; ifstatus) if is_iface_up $INTERFACE ; then - message_if_not_run_from_rc "$INTERFACE is up" + message "`printf " %-9s is up" "$INTERFACE"`" message_if_not_run_from_rc "$(ip addr show $INTERFACE)" - while read a b c d e f g h i; do - message "`printf " %-9s IP address: %s" "$i" "$d"`" - done < <(ip -o -4 addr show $INTERFACE) ifstatus-route $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS} retcode=$R_SUCCESS else @@ -1082,9 +1085,6 @@ # else # message_n "`printf "IP/Netmask: %s / %s " $IPADDR $NETMASK`" fi - if [ "$INTERFACETYPE" == bond ] ; then - message_n " as bonding master" - fi message " " ;; esac @@ -1141,7 +1141,63 @@ ADDRCOUNT=$(($ADDRCOUNT + 1)) done fi + ifup-route $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS} + + # + # OK, all setup done ... check the state now + # + # Do not override codes when already set (e.g. $R_DHCP_BG); + # it is the final action to check the link / dad status. + # + # When called from rcnetwork, do not wait as rcnetwork does. + # + dad_ret=0 + link_ret=0 + + # - check the link (carrier, ...) + # per interface setting, disabled by default + if [ "$retcode" = "$R_SUCCESS" ] ; then + if [ $((LINK_READY_WAIT)) -gt 0 ] ; then + if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then + link_ready_check "$INTERFACE" + link_ret=$? + test "$link_ret" && retcode=$R_DHCP_BG + else + link_ready_wait "$INTERFACE" "${LINK_READY_WAIT}" + link_ret=$? + test "$link_ret" && retcode=$R_NOTRUNNING + fi + fi + fi + + # - check ipv6 dad + # global (and per interface) setting, enabled by default + # when the link isn't ready yet, the addresses are marked tentative + # dad starts when the link becomes ready and we wait until success + # or dad failure. + if [ "$retcode" = "$R_SUCCESS" ] ; then + IPV6_DAD_WAIT=${IPV6_DAD_WAIT:-$((WAIT_FOR_INTERFACES/2))} + if [ $((IPV6_DAD_WAIT)) -gt 0 ] ; then + if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then + ipv6_addr_dad_check "$INTERFACE" + dad_ret=$? + else + ipv6_addr_dad_wait "$INTERFACE" "${IPV6_DAD_WAIT}" + dad_ret=$? + fi + case $dad_ret in + 1|2) retcode=$R_NOTRUNNING ;; + 3) retcode=$R_DHCP_BG ;; + esac + fi + fi + + # inform ifstatus to update status connecting flag + if [ $retcode -eq $R_DHCP_BG -a \( $link_ret -ne 0 -o $dad_ret -ne 0 \) ] ; then + write_cached_config_data verify status $INTERFACE + fi + ;; ifdown) case "$BOOTPROTO" in @@ -1163,19 +1219,76 @@ ;; ifstatus) if is_iface_up $INTERFACE ; then - message_if_not_run_from_rc "$INTERFACE is up" message_if_not_run_from_rc "$(ip addr show $INTERFACE)" - while read a b c d e f g h i; do - message "`printf " %-9s IP address: %s" "$i" "$d"`" - done < <(ip -o -4 addr show $INTERFACE) + if [ "$RUN_FROM_RC" = "yes" ]; then + while read a b c d e f g h i; do + message "`printf " %-9s IP address: %s" "$i" "$d"`" + done < <(ip -o -4 addr show $INTERFACE) + while read a b c d e f g h i; do + test "$f" = "global" || continue + message "`printf " %-9s IP address: %s" "$b" "$d"`" + done < <(ip -o -6 addr show $INTERFACE) + fi + ifstatus-route $CONFIG $INTERFACE ${OPTIONS:+-o $OPTIONS} + + dad_ret=0 + link_ret=0 retcode=$R_SUCCESS + + # - check the link + if [ $((LINK_READY_WAIT)) -gt 0 ] ; then + link_ready_check "$INTERFACE" + link_ret=$? + if [ "$BOOTING" = yes -a "$RUN_FROM_RC" = yes ] ; then + test "$link_ret" && retcode=$R_DHCP_BG + else + test "$link_ret" && retcode=$R_NOTRUNNING + fi + fi + + # - check ipv6 dad + if [ "$retcode" = "$R_SUCCESS" ] ; then + IPV6_DAD_WAIT=$((${IPV6_DAD_WAIT:-$((WAIT_FOR_INTERFACES/2))})) + if [ $((IPV6_DAD_WAIT)) -ge 0 ] ; then + ipv6_addr_dad_check "$INTERFACE" + dad_ret=$? + case $dad_ret in + 1|2) retcode=$R_NOTRUNNING ;; + 3) retcode=$R_DHCP_BG ;; + esac + fi + fi + + # OK, now show the results + case $link_ret in + 0) + # in link problem cases, IPv6 dad status is not yet interesting + msg="is up" + case $dad_ret in + 2) msg="is up, but ipv6 duplicate address check failed";; + 3) msg="is up, but has tentative ipv6 address";; + esac + message "`printf " %-9s $msg" "$INTERFACE"`" ;; + 1) message "`printf " %-9s is not up" "$INTERFACE"`" ;; + 2) message "`printf " %-9s is dormant" "$INTERFACE"`" ;; + 3) message "`printf " %-9s has no carrier" "$INTERFACE"`" ;; + esac + + if [ "$retcode" = "$R_SUCCESS" ] ; then + v=`read_cached_config_data verify $INTERFACE` + s=`read_cached_config_data status $INTERFACE` + if test "$v" = "status" -a "$s" = "connecting" ; then + write_cached_config_data status connected $INTERFACE + commit_cached_config_data $INTERFACE + fi + fi else # message_if_not_run_from_rc "$INTERFACE is down" message "`printf " %-9s is down" $INTERFACE`" retcode=$R_NOTRUNNING case "$STARTMODE" in - manual|off) retcode=$R_INACTIVE ;; + manual|off) retcode=$R_INACTIVE ;; esac fi ;; @@ -1201,7 +1314,7 @@ test "$CHECK" = yes -a $ret != 0 && retcode=$ret DEP_IFACES=`get_depending_ifaces $INTERFACE` if [ "$?" = 0 -a "$NODEPS" != yes ] ; then - message "`printf " %-9s is still used from interfaces %s" \ + message "`printf " %-9s is used from interfaces %s" \ $INTERFACE "$DEP_IFACES"`" #for DI in $DEP_IFACES; do # ifstatus $DI -o $OPTIONS diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/scripts/network new/sysconfig-0.75.3/scripts/network --- old/sysconfig-0.75.2/scripts/network 2011-09-08 15:56:29.000000000 +0200 +++ new/sysconfig-0.75.3/scripts/network 2011-09-26 12:03:18.000000000 +0200 @@ -55,10 +55,27 @@ test "$DEBUG" = "EXTRA" && . scripts/extradebug +systemd_running () { + # We simply test whether systemd cgroup hierarchy is mounted + # where we return 0, non-zero if not. + /bin/mountpoint -q /sys/fs/cgroup/systemd +} +systemd_booting () { + # returns 0 when we boot, 1 in running system + systemctl show -p ActiveState default.target | grep -qi inactive +} + # Only use ifup option 'onboot' if booting or changing runlevel -# Therefore we check if we were called from init +# Therefore we check if we were called from init or systemd is booting. FS_FILTER="" -if [ -n "$INIT_VERSION" -a -z "$YAST_IS_RUNNING" ] ; then +SD_RUNNING=no +SD_BOOTING=no +if systemd_running ; then + SD_RUNNING=yes + systemd_booting && SD_BOOTING=yes +fi +if [ \( -n "$INIT_VERSION" -o "$SD_BOOTING" = yes \) -a \ + -z "$YAST_IS_RUNNING" ] ; then MODE=onboot FS_FILTER=localfs fi @@ -102,29 +119,21 @@ || exit $R_INTERNAL -systemd_running () { -# We simply test whether systemd cgroup hierarchy is mounted - if /bin/mountpoint -q /sys/fs/cgroup/systemd ; then - return 1 - fi - return 0 -} - ###################################################################### -# Start NetworkManager if wanted +# Handle NetworkManager start when requested # # Some variables and functions are defined in # /etc/sysconfig/network/scripts/functions # because they are also used in ifup # if [ "$NETWORKMANAGER" = yes ] ; then - systemd_running ; sd=$? - if [ "$FS_FILTER" = "localfs" -o $sd = 1 ] ; then - # NetworkManager is not supported without remotefs - # and will be started later via network-remotefs. - # NetworkManager should be started with its own .service - # under systemd + if [ "$FS_FILTER" = "localfs" ] ; then + # Under systemd, NetworkManager is started via its + # own .service file, thus never while localfs is set. + # Otherwise, NetworkManager will be started later via + # network-remotefs init script (it is installed in + # /usr, thus depends on already started remotefs). case $ACTION in (status) exit 3 ;; (start) exit 0 ;; @@ -137,7 +146,38 @@ "Please set" \ "\n/etc/sysconfig/network/config:NetworkManager=no" \ "or install NetworkManager." + elif [ "$SD_RUNNING" = "yes" ] ; then + # NetworkManager is started via own .service file under + # systemd, but we forward the restart/reload (sub)actions + # to catch configuration change from/to the NetworkManager. + case $ACTION in + (start) + if netcontrol_running ; then + cd "$OLDPWD" + ./$0 stop + fi + systemctl start NetworkManager.service + exit 0 + ;; + (stop) + systemctl stop NetworkManager.service + ;; + (reload) + if netcontrol_running ; then + cd "$OLDPWD" + ./$0 stop + ./$0 start + fi + systemctl start NetworkManager.service + exit 0 + ;; + (status) exit 3 ;; + (*) exit 6 ;; + esac fi +elif [ "$SD_RUNNING" = "yes" ] && nm_running ; then + # NetworkManager is disabled, stop it + systemctl stop NetworkManager.service fi check_firewall() { @@ -697,8 +737,7 @@ for IFACE in $@; do $FAKE /sbin/ifstatus $CONFIG $IFACE -o rc $CHECK $MODE RET=$? - debug && printf " %-9s returned %s\n" $IFACE $RET || \ - printf " %-9s\n" $IFACE + debug && printf " %-9s returned %s\n" $IFACE $RET case $RET in $R_SUCCESS|$R_BUSY) # : $((R++)) @@ -768,8 +807,7 @@ done $FAKE ifup $CONFIG $IFACE -o rc $MODE RET=$? - debug && printf " %-9s returned %s\n" $IFACE $RET || \ - printf " %-9s\n" $IFACE + debug && printf " %-9s returned %s\n" $IFACE $RET case "$RET" in $R_SUCCESS) SUCCESS_IFACES="$SUCCESS_IFACES $IFACE" @@ -854,7 +892,7 @@ debug "Time to wait: $((WAIT_FOR_INTERFACES - TTWAIT))" if [ "$NEWLINE" != yes ] ; then - echo "Waiting for mandatory devices: $MANDATORY_DEVICES" + echo "Waiting for mandatory devices: ${MANDATORY_DEVICES//__NSC__/}" fi echo -n "$((WAIT_FOR_INTERFACES - TTWAIT)) " NEWLINE=yes @@ -884,7 +922,7 @@ debug SUCCESS_IFACES=$SUCCESS_IFACES debug MANDATORY_DEVICES=$MANDATORY_DEVICES debug FAILED=$FAILED - + debug TTWAIT=$TTWAIT if [ -z "$INTERFACE" ] ; then for IFACE in $VIRTUAL_IFACES ; do @@ -893,8 +931,7 @@ done $FAKE ifup $CONFIG $IFACE -o rc $MODE RET=$? - debug && printf " %-9s returned %s\n" $IFACE $RET || \ - printf " %-9s\n" $IFACE + debug && printf " %-9s returned %s\n" $IFACE $RET case "$RET" in $R_SUCCESS) SUCCESS_IFACES="$SUCCESS_IFACES $IFACE" @@ -909,7 +946,7 @@ $R_NOCONFIG) rc_failed 6 rc_status -v1 - : $((FAILED++)) + # : $((FAILED++)) ;; $R_NOTCONFIGURED|$R_INACTIVE) SUCCESS_IFACES="$SUCCESS_IFACES $IFACE" @@ -919,13 +956,69 @@ *) rc_failed 7 rc_status -v1 - : $((FAILED++)) + # : $((FAILED++)) ;; esac rc_reset done - fi + LINE="" + NEWLINE=no + while true; do + debug ... still waiting for virtual devices: + debug SUCCESS_IFACES=$SUCCESS_IFACES + debug VIRTUAL_IFACES=$VIRTUAL_IFACES + + TMP=$VIRTUAL_IFACES + VIRTUAL_IFACES= + for IFACE in $TMP ; do + for S in $SUCCESS_IFACES; do + test "$IFACE" = "$S" && continue 2 + done + IFACE="`type_filter $IFACE`" + test -z "$IFACE" && continue + status -m $IFACE &>/dev/null + RET=$? + if [ $RET = 0 ] ; then + SUCCESS_IFACES="$SUCCESS_IFACES $IFACE" + if [ "$NEWLINE" = yes ] ; then + echo + NEWLINE=no + fi + status $IFACE + continue + fi + VIRTUAL_IFACES="$VIRTUAL_IFACES $IFACE" + done + + IFS=. read a b < /proc/uptime + TTWAIT2=$((a - (TTWAIT + `cat $NETWORK_RUNFILE`))) + test $TTWAIT2 -gt $((WAIT_FOR_INTERFACES)) \ + -o -z "$VIRTUAL_IFACES" && break + + debug "Time to wait: $((WAIT_FOR_INTERFACES - TTWAIT2))" + if [ "$NEWLINE" != yes ] ; then + echo "Waiting for virtual interfaces: $VIRTUAL_IFACES" + fi + echo -n "$((WAIT_FOR_INTERFACES - TTWAIT2)) " + NEWLINE=yes + sleep 1 + done + + if [ "$NEWLINE" = yes ] ; then + echo + fi + + for IFACE in $VIRTUAL_IFACES; do + if [ -d /sys/class/net/$IFACE ] ; then + status -m $IFACE && continue + printf " %-9s interface is not ready until now\n" $IFACE + fi + rc_failed + rc_status -v1 + : $((FAILED++)) + done + fi rc_reset if [ -z "$INTERFACE" ] ; then @@ -963,8 +1056,7 @@ # printf " %-9s " $IFACE $FAKE ifdown $CONFIG $IFACE -o rc $MODE RET=$? - debug && printf " %-9s returned %s\n" $IFACE $RET || \ - printf " %-9s\n" $IFACE + debug && printf " %-9s returned %s\n" $IFACE $RET rc_failed $RET case "$RET" in $R_NODEV|$R_NOTCONFIGURED|$R_INACTIVE) @@ -1014,8 +1106,7 @@ fi $FAKE ifdown $CONFIG $IFACE -o rc $MODE RET=$? - debug && printf " %-9s returned %s\n" $IFACE $RET || \ - printf " %-9s\n" $IFACE + debug && printf " %-9s returned %s\n" $IFACE $RET rc_failed $RET case "$RET" in $R_NODEV|$R_NOTCONFIGURED|$R_INACTIVE) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/sysconfig-0.75.2/sysconfig.spec new/sysconfig-0.75.3/sysconfig.spec --- old/sysconfig-0.75.2/sysconfig.spec 2011-09-08 16:00:01.000000000 +0200 +++ new/sysconfig-0.75.3/sysconfig.spec 2011-09-26 12:40:20.000000000 +0200 @@ -19,7 +19,7 @@ Name: sysconfig -Version: 0.75.2 +Version: 0.75.3 Release: 0 Summary: The sysconfig scheme and traditional network scripts Url: http://gitorious.org/opensuse/sysconfig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun... -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
