You are not logged in.

#1 2007-05-01 20:06:41

phildg
Member
Registered: 2006-03-10
Posts: 146

/etc/rc.d/network and net profiles

Hi,

I think it makes more sense to initiate the network interfaces in INTERFACES before attempting to initiate the profiles in NET_PROFILES. Especially considering that it is expected for lo0 to be in INTERFACES.

In my case I have a few profiles for different places and have the network daemon backgrounded, because some of these profiles are taking time to time out and move onto the next one it takes a while before a loopback interface is created. In the meantime other daemons that rely on the loopback interface (cups, fam) are failing to start. If I manage to log into xfce before a network device is initialized then half of xfce fails to work.

Perhaps it would make even more sense to have a separate script for network profiles and interfaces placed in INTERFACES. That way we can have the loopback created in-line with other daemons and background the script to find a profile that works. We can then guarantee a loopback device is ready before starting daemons that rely on it.

I know this problem disappears if I don't background the network daemon, but time is wasted waiting for the network to initialise.

I can upload my hacked /etc/rc.d/network if needed/wanted, but it may have introduced problems I have not thought about and not yet encountered. I'll have a look into creating a separate script for net profiles this weekend - it should only involve shuffling code around.

Course, this is only really relevant to laptop users.

Offline

#2 2007-05-02 13:45:43

phildg
Member
Registered: 2006-03-10
Posts: 146

Re: /etc/rc.d/network and net profiles

Doesn't seem to be much interest in this, oh well.

Here is a patch that will implement my alterations for anyone who'd like to follow up on it

--- /etc/rc.d/network.orig    2007-05-02 14:31:09.000000000 +0100
+++ /etc/rc.d/network    2007-05-02 14:31:17.000000000 +0100
@@ -163,27 +163,6 @@
             echo "Network is already running.  Try 'network restart'"
             exit
         fi
-
-        # See if we're using network profiles
-        if [ "$NET" ]; then
-            # This env var is passed from the kernel boot line
-            if [ "$NET" = "menu" ]; then
-                /usr/bin/netcfg --menu --timeout 5
-            else
-                /usr/bin/netcfg $NET
-            fi
-        elif [ "$NET_PROFILES" ]; then
-            if [ "$NET_PROFILES" = "menu" ]; then
-                /usr/bin/netcfg --menu --timeout 5
-            else
-                for prof in ${NET_PROFILES[@]}; do
-                    if [ "$prof" = "${prof#!}" ]; then
-                        /usr/bin/netcfg -c $prof
-                    fi
-                done
-            fi
-        fi
-
         stat_busy "Starting Network"
         error=0
         # bring up bridge interfaces
@@ -208,6 +187,27 @@
         else
             stat_fail
         fi
+
+        # See if we're using network profiles
+        if [ "$NET" ]; then
+            # This env var is passed from the kernel boot line
+            if [ "$NET" = "menu" ]; then
+                /usr/bin/netcfg --menu --timeout 5
+            else
+                /usr/bin/netcfg $NET
+            fi
+        elif [ "$NET_PROFILES" ]; then
+            if [ "$NET_PROFILES" = "menu" ]; then
+                /usr/bin/netcfg --menu --timeout 5
+            else
+                for prof in ${NET_PROFILES[@]}; do
+                    if [ "$prof" = "${prof#!}" ]; then
+                        /usr/bin/netcfg -c $prof
+                    fi
+                done
+            fi
+        fi
+
         ;;
     stop)
         #if ck_daemon network; then

Offline

#3 2007-05-02 14:51:30

bender02
Member
From: UK
Registered: 2007-02-04
Posts: 1,329

Re: /etc/rc.d/network and net profiles

That's actually almost exactly what I did to my rc.d/network, for exactly the same reason - I want the lo interface to start asap, while the wireless might take its time, or even not connect.

Offline

#4 2007-05-03 08:09:35

iphitus
Forum Fellow
From: Melbourne, Australia
Registered: 2004-10-09
Posts: 4,927

Re: /etc/rc.d/network and net profiles

I'm currently developing new network scripts, and in them, rc.d/network has been seperated from profiles entirely, with rc.d/net-profiles

http://wiki.archlinux.org/index.php/Network_Scripts

James

Offline

#5 2007-05-03 09:00:12

dr_te_z
Member
From: Zoetermeer, the Netherlands
Registered: 2006-12-06
Posts: 154

Re: /etc/rc.d/network and net profiles

iphitus wrote:

I'm currently developing new network scripts, and in them, rc.d/network has been seperated from profiles entirely, with rc.d/net-profiles

Good news. This will answer this http://bbs.archlinux.org/viewtopic.php?id=28947 as well


Somewhere between "too small" and "too large" lies the size that is just right.
- Scott Hayes

Offline

#6 2007-05-03 21:25:28

phildg
Member
Registered: 2006-03-10
Posts: 146

Re: /etc/rc.d/network and net profiles

iphitus wrote:

I'm currently developing new network scripts, and in them, rc.d/network has been seperated from profiles entirely, with rc.d/net-profiles

http://wiki.archlinux.org/index.php/Network_Scripts

James

Seems I should have searched the site more thoroughly then wink.

I look forward to seeing them complete, or if time permits testing them even

Offline

Board footer

Powered by FluxBB