New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 624660 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

Chameleon: Needs a cron job to check network status

Project Member Reported by cychiang@chromium.org, Jun 30 2016

Issue description

We may add a cron job in the chameleon image to check the network regularly. When a network outage, restart the network stack or reboot Chameleon.
 
Sometimes /etc/init.d/networking restart fails to get IP.
But subsequent call succeeds.

E.g.
root@socfpga:~# /etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
Reconfiguring network interfaces... 
[233159.763265] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
udhcpc (v1.20.2) started
Sending discover...
Sending discover...
[233163.751818] socfpga-dwmac ff702000.ethernet eth0: Link is Up - 1Gbps/Full - flow control off
[233163.760814] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
Sending discover...
No lease, failing

root@socfpga:~# /etc/init.d/networking restart
Running /etc/init.d/networking restart is deprecated because it may not enable again some interfaces
Reconfiguring network interfaces... 
ifdown: interface eth0 not configured
udhcpc (v1.20.2) started
Sending discover...
Sending select for 100.102.7.161...
Lease of 100.102.7.161 obtained, lease time 1800
/etc/udhcpc.d/50default: Adding DNS 172.16.255.1
/etc/udhcpc.d/50default: Adding DNS 172.16.255.153
/etc/udhcpc.d/50default: Adding DNS 172.16.255.53
done.

After discussion with Tom, we plan to add this with pure python.
This schedule module is available on pip and suits our need.

https://github.com/dbader/schedule

We can create a service that runs a python script at boot.
In that script, we can do whatever job we want.
Status: Started (was: Untriaged)
Summary: Chameleon: Needs a cron job to check network status (was: Chameleon: Needs a crob job to check network status)
 https://chromium-review.googlesource.com/391909 Add scheduler daemon to do scheduled job
can fix this.
Thanks!
Project Member

Comment 4 by bugdroid1@chromium.org, Oct 4 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/chameleon/+/91e048d29e1962f951985a7d92d06f5ff62e2a0e

commit 91e048d29e1962f951985a7d92d06f5ff62e2a0e
Author: Cheng-Yi Chiang <cychiang@chromium.org>
Date: Mon Oct 03 07:45:22 2016

Add scheduler daemon to do scheduled job

In some network environment, networking may not get IP at the first
attempt. Install a scheduler so it can check network status
periodically.

BUG= chromium:624660 
TEST=Unplugs ethernet, stop networking, and plugs ethernet back.
     Observer /var/log/scheduler_init at the same time and see it
     restarts networking to bring back network.

Change-Id: I331af39346ef867190157c02631fd22fef2b4447
Reviewed-on: https://chromium-review.googlesource.com/391909
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>

[modify] https://crrev.com/91e048d29e1962f951985a7d92d06f5ff62e2a0e/deploy/deploy
[add] https://crrev.com/91e048d29e1962f951985a7d92d06f5ff62e2a0e/deploy/init.d/scheduler
[add] https://crrev.com/91e048d29e1962f951985a7d92d06f5ff62e2a0e/utils/run_scheduler
[modify] https://crrev.com/91e048d29e1962f951985a7d92d06f5ff62e2a0e/MANIFEST.in
[add] https://crrev.com/91e048d29e1962f951985a7d92d06f5ff62e2a0e/chameleond/utils/network_utils.py
[modify] https://crrev.com/91e048d29e1962f951985a7d92d06f5ff62e2a0e/setup.py

Status: Fixed (was: Started)

Sign in to add a comment