Skip to contentSkip to conversation

Fix ifup.sh to always execute initqueue/online hook after bringing up an interface

PATCH In review Dennis Schridde 3 participants 6 messages Apr 11, 2013 – May 17, 2013 3 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix ifup.sh to always execute initqueue/online hook after bringing up an interface

---
 modules.d/40network/ifup.sh | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
modules.d/40network/ifup.sh +7 -13
index 526251f..13be22a 100755
@@ -307,19 +307,13 @@ for p in $(getargs ip=); do
             do_static ;;
     esac
 
-    case $autoconf in
-        dhcp|on|any|dhcp6)
-            ;;
-        *)
-            if [ $? -eq 0 ]; then
-                setup_net $netif
-                source_hook initqueue/online $netif
-                if [ -z "$manualup" ]; then
-                    /sbin/netroot $netif
-                fi
-            fi
-            ;;
-    esac
+    if [ $? -eq 0 ]; then
+        setup_net $netif
+        source_hook initqueue/online $netif
+        if [ -z "$manualup" ]; then
+            /sbin/netroot $netif
+        fi
+    fi
 
     break
 done
Signature · 1 line
1.8.1.5

A message that is not in the archive (sent off-list or not yet received): 1365694894-7926-1-git-send-email-devurandom-hi6Y0CQ0nG0@public.gmane.org

#2 lore raw

Am 11.04.2013 17:41, schrieb Dennis Schridde:

Quoted 26 lines
---
 modules.d/40network/ifup.sh | 20 +++++++-------------
 1 file changed, 7 insertions(+), 13 deletions(-)
modules.d/40network/ifup.sh +0 -13
index 526251f..13be22a 100755
@@ -307,19 +307,13 @@ for p in $(getargs ip=); do
             do_static ;;
     esac
 
-    case $autoconf in
-        dhcp|on|any|dhcp6)
-            ;;
-        *)
-            if [ $? -eq 0 ]; then
-                setup_net $netif
-                source_hook initqueue/online $netif
-                if [ -z "$manualup" ]; then
-                    /sbin/netroot $netif
-                fi
-            fi
-            ;;
-    esac

modules.d/40network/ifup.sh for p in $(getargs ip=); do · line 319

Quoted 10 lines
modules.d/40network/ifup.sh +7 -0
+    if [ $? -eq 0 ]; then
+        setup_net $netif
+        source_hook initqueue/online $netif
+        if [ -z "$manualup" ]; then
+            /sbin/netroot $netif
+        fi
+    fi
 
     break
 done

IIRC, that is done, as soon as the dhcp client gets an IP

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw

Am Donnerstag, 11. April 2013, 17:44:08 schrieb Harald Hoyer:

Quoted 1 line

IIRC, that is done, as soon as the dhcp client gets an IP

These patches are already a few months old, so dracut's behaviour may very well have changed in the meantime. Where does what you describe happen?

--Dennis

#5 lore raw
Quoted 2 lines · Dennis Schridde

Am Donnerstag, 11. April 2013, 17:44:08 schrieb Harald Hoyer:

Quoted 1 line

IIRC, that is done, as soon as the dhcp client gets an IP

Technically it doesn't happen *immediately* - it adds a job to the initqueue, and that job will run the initqueue/online hook.

Quoted 2 lines

These patches are already a few months old, so dracut's behaviour may very well have changed in the meantime. Where does what you describe happen?

See 40network/dhclient-script.sh - when $reason is BOUND (i.e. initial binding to a new address, as per dhclient-script(8)), it adds a job named "setup_net_$netif.sh" to the initqueue.

Hope that helps,

-w

A message that is not in the archive (sent off-list or not yet received): 1367349915.2614.5.camel-s6BhOCdKmxS3M6m420IelR/[email protected]

#7 lore raw

Hello!

Am Dienstag, 30. April 2013, 15:25:15 schrieb Will Woods:

Quoted 7 lines · Dennis Schridde
Quoted 2 lines

Am Donnerstag, 11. April 2013, 17:44:08 schrieb Harald Hoyer:

Quoted 1 line

IIRC, that is done, as soon as the dhcp client gets an IP

Technically it doesn't happen *immediately* - it adds a job to the initqueue, and that job will run the initqueue/online hook.

Quoted 6 lines
Quoted 2 lines

These patches are already a few months old, so dracut's behaviour may very well have changed in the meantime. Where does what you describe happen?

See 40network/dhclient-script.sh - when $reason is BOUND (i.e. initial binding to a new address, as per dhclient-script(8)), it adds a job named "setup_net_$netif.sh" to the initqueue.

Thanks for that information!

I removed the patch and discovered some bugs and misconceptions about the inner workings of dracut in my own code. It works now without the patch.

Best regards,
Dennis

#8 lore raw
In reply to a message not in the archive

Hello!

This fix is required for net_add_parse_vars in my "[PATCH 1/2] [40network] Add variable parsing framework for network related variables" to work properly.

The online hook was previously not executed for dhcp enabled interfaces, which resulted in my code not being executed.

--Dennis