A simple method to enable a background service program in an Embedded System
In the embedded operating system, because the system is simple and small, the General Service Program is an independent program running permanently in the background, and there is no special management service program. The following is a simple method:
For a new system, wireless_tools can be used to manually connect to the Wi-Fi network and convert the manual connection to the automatic connection script/etc/sysconfig/WiFi/wifid, the idea of setting it to boot automatically is: in/etc/init. add the startup script command in D/RC. Due to poor signal, WiFi is offline. Therefore, you need to add a script (Service Program) that is always running in the background. This script continuously scans for Wi-Fi connections, log On again immediately after the disconnection (if it can be used as a signal drive, it will be better, and study again later ).
However, we know from practice that in/etc/init. d/RCS can be connected when/etc/sysconfig/WiFi/wifid is added and started, but the service program does not get up. After a long time, it will not work, finally, the implementation will be transferred to the/etc/inittab and finally solved.
Comment out the line: askfirst:-/bin/sh and add the following two sentences:
: Respawn:-/bin/sh
: Once:/etc/init. d/ifconfig-WiFi
Comment out: askfirst:-/bin/sh to: respawn:-/bin/sh. After the instance is started, you do not need to wait for the user to press the Enter key to enter the shell environment, then run the script/etc/init. d/ifconfig-WiFi (run/etc/sysconfig/WiFi/wifid in this script ).
After the restart, the system automatically runs the service script/etc/sysconfig/WiFi/wifid.