Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ An example of troubleshooting of embedded Linux OpenWRT     - VMware ghost Linux card error (Linux)

- How to ensure that the Internet will not be attacked (Linux)

- Nginx-1.9.7 TCP reverse proxy (Server)

- What Java 8 fastest garbage collector (Programming)

- Linux System Getting Started Learning: the curl set custom HTTP header (Linux)

- To use slay kill user processes (Linux)

- Mybatis + binding Struts2: achieving user to insert and find (Programming)

- 10 important Linux ps command combat (Linux)

- Installation and Configuration Tomcat environment CentOS 6.6 (Server)

- Ubuntu Linux Change the PATH (Linux)

- Three details reflect the Unix system security (Linux)

- Oracle 12CIN-memory in table spaces (Database)

- To disable the function by pressing Ctrl-Alt-Del to restart the system in RHEL / CentOS 5/6 (Linux)

- Linux data redirection (Linux)

- MySQL combination Git achieve differential backups can be used in the production environment (Database)

- A drop datafile Oracle bug (Database)

- Windows 8.1 and Ubuntu 14.04 dual system uninstall Ubuntu Tutorial (Linux)

- Hibernate + JUnit test entity class generate database table (Programming)

- How to use awk command in Linux (Linux)

- Piostat - Monitoring and Statistics Linux process (Linux)

  An example of troubleshooting of embedded Linux OpenWRT
  Add Date : 2017-04-13      
  Embedded Linux OpenWRT example of troubleshooting with large data does not matter, just to help a friend a busy row of record it wrong.

Before relations are very good colleagues, currently in the field of enterprise wifi business, purchasing our big data services, it is to give him a platform to build and debug. Then he was the CEO these days when debugging router encountered some problems, engaged in large data while incidentally gave his hand to solve the problem.

OpenWRT, embedded Linux, mainly used in the MIPS or ARM devices. Many routers and wifi equipment will use this system, and there is light.

Coova-Chilli, the access under the Access Controller openwrt provide authentication gateway, you can use the radius or http access charging to do other work.

Normal, after the start chilli, starts four tun virtual tunnel card, but the fault is sporadic, from time to time there will be two IP addresses the same tun device. Such is the case






Under normal circumstances the device should only tun0-3, but every time you launch one or two more tun, and is not fixed, sometimes tun0-1 IP address the same, sometimes tun2-3 IP address of the same. And OpenWRT default is not recorded in the syslog. Difficult to troubleshoot. In fact, you can read syslog logread from the inside, but in fact no syslog record anything.

That buddy is before writing code, working hard and making the night three did not find what the problem is, they contain a variety of startup scripts recorded log in chilli, wait, sleep, no use. After the last afternoon of the current demand for big data platform on the right, and then I gave him pain free eggs looked at the script, chilli script should not have too many problems, then he is the official deployment documentation structures. Beginning did not see what the problem is. chilli default script is on the /etc/init.d directory. Ordinarily there is no problem, then the pleasure came, he told me he had written a command in rc.local do start, I looked at rc.local inside, he wrote a startup script in the / root below. vi The startup script in / root, and there wrote a /etc/init.d/chilli restart. I asked him why it was used, he said, let wrt official wrote that write insurance. I try to write off the line restart, restart 10 times, tun tunnel are no problem. 20 minutes to get.

problem analysis

chilli original script as follows

#! / Bin / sh
# Provides: chilli
# Required-Start: $ remote_fs $ syslog $ network
# Required-Stop: $ remote_fs $ syslog $ network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start CoovaChilli daemon at boot time
# Description: Enable CoovaChilli service provided by daemon.
PATH = / sbin: / bin: / usr / sbin: / usr / bin
DAEMON = / usr / sbin / chilli
NAME = chilli
DESC = chilli
if [-f / etc / default / chilli]; then
. / Etc / default / chilli
if [ "$ START_CHILLI" = "1"!]; then
echo "Chilli default off. Look at / etc / default / chilli"
exit 0
test -f $ DAEMON || exit 0
. / Etc / chilli / functions
MULTI = $ (ls /etc/chilli/*/chilli.conf 2> / dev / null)
[-z "$ DHCPIF"] && [-n "$ MULTI"] && {
for c in $ MULTI;
    echo "Found configuration $ c"
    DHCPIF = $ (basename $ (echo $ c | sed 's # / chilli.conf ##'))
    export DHCPIF
    echo "Running DHCPIF = $ DHCPIF $ 0 $ *"
    sh $ 0 $ *
if [-n "$ DHCPIF"]; then
CONFIG = / etc / chilli / $ DHCPIF / chilli.conf
CONFIG = / etc / chilli.conf
[-f $ CONFIG] || {
echo "$ CONFIG Not found"
exit 0
prog = "chilli"
case "$ 1" in
    echo -n "Starting $ DESC:"
    / Sbin / modprobe tun> / dev / null 2> & 1
    echo 1> / proc / sys / net / ipv4 / ip_forward
    test $ {HS_ADMINTERVAL: -0} -gt 0 && {
(Crontab -l 2> & - | grep -v $ 0
        echo "* / $ HS_ADMINTERVAL * * * * $ 0 radconfig"
        ) | Crontab - 2> & -
    ifconfig $ HS_LANIF
    start-stop-daemon --start --quiet --pidfile /var/run/$NAME.$HS_LANIF.pid \
        --exec $ DAEMON - -c $ CONFIG
    RETVAL = $?
    echo "$ NAME."
    check = `start-stop-daemon --start --exec $ DAEMON --test`
    if [x "$ check" = x "$ DAEMON already running."!]; then
$ 0 start
    [-e $ MAIN_CONF] || writeconfig
    $ 0 stop
    sleep 1
    $ 0 start
    RETVAL = $?
    echo -n "Stopping $ DESC:"
    crontab -l 2> & - | grep -v $ 0 | crontab -
    start-stop-daemon --oknodo --stop --quiet --pidfile /var/run/$NAME.$HS_LANIF.pid \
    --exec $ DAEMON
    echo "$ NAME."
    echo "Reloading $ DESC."
    start-stop-daemon --stop --signal 1 --quiet --pidfile \
    /var/run/$NAME.$HS_LANIF.pid --exec $ DAEMON
    check = `start-stop-daemon --start --exec $ DAEMON --test`
    if [x "$ check" = x "$ DAEMON already running."!]; then
$ 0 restart
    status chilli
    RETVAL = $?
    N = / etc / init.d / $ NAME
    echo "Usage: $ N {start | stop | restart | condrestart | status | reload | radconfig}"> & 2
    exit 1
exit 0

The problem is that when debugging him in for c in $ MULTI inside the loop, in order to ensure that each child process started successfully, plus a wait, back in time in order to establish tun channel debug added a few sleep. According to official documents, he added to the inside of a restart rc.local, so the problem comes, / etc / init.d which is automatically executed chilli start command, and added wait and sleep. init.d startup script will wait, but this time in a different Linux tty has launched a rc.local inside chilli restart command, then two or three identical tun IP address will co-exist.

Anyway, the problem is solved, and in view of this he stayed three night break things, I can tone prophet of education this person debugger CEO: "Believe everything the book as no book." Official documentation of open source systems tend to lag behind, the new version may need to restart long ago solved the problem, but the document does not update, lead to such problems.

Summary, understand how the various systems of how important it is.
- Comparison of one-time transaction and CTE insert data (Database)
- Ten best plug surge Emacs Productivity (Linux)
- Based kubernetes Construction Docker Cluster Management Comments (Server)
- iTerm - let your command line can also be colorful (Linux)
- iptraf: A Practical TCP / UDP network monitoring tools (Linux)
- HA-Federation-HDFS + Yarn cluster deployment (Server)
- 6 common PHP security attacks (Linux)
- Nonstandard IMP-00010 error processing one case (Database)
- Oracle for Oracle GoldenGate to achieve a one-way synchronization DDL operations (Database)
- Using Linux stat command to view the files (Linux)
- To install MySQL 5.6 binary packages under CentOS 6.4 64bit (Database)
- Linux rpm command Detailed (Linux)
- Hadoop 2.0 Detailed Configuration Tutorial (Server)
- Creating and extracting archives 11 tar command examples in Linux (Linux)
- Setting Squid successful anti-hotlinking (Linux)
- Dalvik heap memory management and recycling (Linux)
- Use the dd command to the hard disk I / O performance test (Linux)
- Linux operating process information (Linux)
- Linux system Perl Lite netstat (Linux)
- How to install Laravel PHP framework on CentOS 7 / Ubuntu 15.04 (Server)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.