All of lore.kernel.org
 help / color / mirror / Atom feed
* [SOLVED]Network init script error??
       [not found] <30166055.post@talk.nabble.com>
@ 2010-11-09  4:39 ` Steve Sakoman
  2010-11-09 18:47   ` Philip Balister
  0 siblings, 1 reply; 2+ messages in thread
From: Steve Sakoman @ 2010-11-09  4:39 UTC (permalink / raw)
  To: openembedded-devel; +Cc: General mailing list for gumstix users.

Looping in the OE developers list on the issue described below.

It does indeed seem that the ifupdown package init is referencing
/etc/network/ifstate (which doesn't exist) instead of
/etc/network/run/ifstate.

Mike's point about having the /etc/network/run directory linked to
/var/run also seems like a good idea (so that ifstate would not
persist after an unclean shutdown).

Thoughts?

Steve


---------- Forwarded message ----------
From: roystonvasey <mikestocks@madasafish.com>
Date: Mon, Nov 8, 2010 at 7:14 PM
Subject: [Gumstix-users]  [SOLVED]Network init script error??
To: gumstix-users@lists.sourceforge.net



Dear List,
I as many others are having problems getting the networking to start
reliably on headless systems, wlan0 in particular.
If the network is restarted '/etc/init.d/networking restart' wireless and my
CAN networks come up OK, on system halt and reboot they also come up OK.
If power is interrupted the networks are not starting after a reboot and
require a manual restart.

After some investigations I noticed that there is an initialisation script
'/etc/rcS.d/S39ifup' that is run just before the network is started with
'/etc/rcS.d/S40networking'. The script looks like it clears up any hanging
ifstate files.
#!/bin/sh -e

case "$1" in
       start|restart)
               if [ -e /etc/network/ifstate ]; then
                       echo -n "Cleaning: /etc/network/ifstate"
                       echo -n >/etc/network/ifstate
                       echo "."
               fi
               ;;
       stop|reload|force-reload)
               ;;
esac

However the actual ifstate file is created in '/etc/network/run/ifstate'.
Adjusting the script allows the network to come up properly even after a
power outage.
I suspect that ifup checks ifstate to see if the interface is already up and
doesn't do anything if there is an entry in the ifstate file and ifdown
takes out etries as it brings down the interface. Hence a clean shut down
will clear entries and allow the the networks to start normally on start up.
The other observation is that the '/etc/network/run' directory should
probably be linked to the '/var/run' directory.

Can anyone verify that my findings are correct an see about amending the
init scripts?

Cheers Mike.
--
View this message in context:
http://old.nabble.com/-SOLVED-Network-init-script-error---tp30166055p30166055.html
Sent from the Gumstix mailing list archive at Nabble.com.



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [SOLVED]Network init script error??
  2010-11-09  4:39 ` [SOLVED]Network init script error?? Steve Sakoman
@ 2010-11-09 18:47   ` Philip Balister
  0 siblings, 0 replies; 2+ messages in thread
From: Philip Balister @ 2010-11-09 18:47 UTC (permalink / raw)
  To: openembedded-devel

On 11/08/2010 08:39 PM, Steve Sakoman wrote:
> Looping in the OE developers list on the issue described below.
>
> It does indeed seem that the ifupdown package init is referencing
> /etc/network/ifstate (which doesn't exist) instead of
> /etc/network/run/ifstate.
>
> Mike's point about having the /etc/network/run directory linked to
> /var/run also seems like a good idea (so that ifstate would not
> persist after an unclean shutdown).

Fixing the script removes the state file before it is checked on boot, 
so I do not think it is necessary to move the state file to a volatile 
file system. I'm going to push the fix to the ifupdown package. There is 
also ifupdown-ubuntu, but I am not sure who is using that. It references 
/var/run/....

Philip


>
> Thoughts?
>
> Steve
>
>
> ---------- Forwarded message ----------
> From: roystonvasey<mikestocks@madasafish.com>
> Date: Mon, Nov 8, 2010 at 7:14 PM
> Subject: [Gumstix-users]  [SOLVED]Network init script error??
> To: gumstix-users@lists.sourceforge.net
>
>
>
> Dear List,
> I as many others are having problems getting the networking to start
> reliably on headless systems, wlan0 in particular.
> If the network is restarted '/etc/init.d/networking restart' wireless and my
> CAN networks come up OK, on system halt and reboot they also come up OK.
> If power is interrupted the networks are not starting after a reboot and
> require a manual restart.
>
> After some investigations I noticed that there is an initialisation script
> '/etc/rcS.d/S39ifup' that is run just before the network is started with
> '/etc/rcS.d/S40networking'. The script looks like it clears up any hanging
> ifstate files.
> #!/bin/sh -e
>
> case "$1" in
>         start|restart)
>                 if [ -e /etc/network/ifstate ]; then
>                         echo -n "Cleaning: /etc/network/ifstate"
>                         echo -n>/etc/network/ifstate
>                         echo "."
>                 fi
>                 ;;
>         stop|reload|force-reload)
>                 ;;
> esac
>
> However the actual ifstate file is created in '/etc/network/run/ifstate'.
> Adjusting the script allows the network to come up properly even after a
> power outage.
> I suspect that ifup checks ifstate to see if the interface is already up and
> doesn't do anything if there is an entry in the ifstate file and ifdown
> takes out etries as it brings down the interface. Hence a clean shut down
> will clear entries and allow the the networks to start normally on start up.
> The other observation is that the '/etc/network/run' directory should
> probably be linked to the '/var/run' directory.
>
> Can anyone verify that my findings are correct an see about amending the
> init scripts?
>
> Cheers Mike.
> --
> View this message in context:
> http://old.nabble.com/-SOLVED-Network-init-script-error---tp30166055p30166055.html
> Sent from the Gumstix mailing list archive at Nabble.com.
>
> _______________________________________________
> Openembedded-devel mailing list
> Openembedded-devel@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-devel
>



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-11-09 18:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <30166055.post@talk.nabble.com>
2010-11-09  4:39 ` [SOLVED]Network init script error?? Steve Sakoman
2010-11-09 18:47   ` Philip Balister

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.