Auto-start at boot

1. Set up auto-startservice

  1. Create a startup script

    Use any text editor to create a new startup script in the /etc/init.d directory. Assume it is named your_script_name. Here is the sample script for reference.

  2. Set the startup script to have executable permissions.

  3. Use the update-rc.d command to add the script to the system startup item.

  4. Use the systemctl command to enable automatic startup.

  5. Restart the development board to verify whether the self-start service program is running normally.

验证

2. Add to rc.local service

rc.local is a system service that is used to automatically execute some scripts or commands when the system starts.

This service will be automatically called when the system starts, and execute some user-specified scripts or commands after the system starts, so as to perform custom configuration or operations when the system starts.

In early Linux distributions, rc.local was the last service that ran by default during the system startup process. With the popularity of systemd, rc.local is regarded as a legacy system service.

It is implemented by adding a startup command at the end of the sudo vim /etc/rc.local file, for example.