A simple method to enable a background service program in an Embedded System

Source: Internet
Author: User

 

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.