Welcome to RDK S100(P) Board repository
2.4 Boot Auto-Start Configuration
Boot Auto-Start Configuration
1. Configure an Auto-Start Service
Create a startup script
Use any text editor to create a new startup script in the
/etc/init.ddirectory. Assume the script is namedyour_script_name. Below is a sample script for reference:### BEGIN INIT INFO# Provides: your_service_name# Required-Start: $all# Required-Stop:# Default-Start: 2 3 4 5# Default-Stop: 0 1 6# Short-Description: Start your_service_name at boot time# Description: Enable service provided by your_service_name### END INIT INFO/path/to/your/program &exit 0Make the startup script executable
xxxxxxxxxxsudo chmod +x /etc/init.d/your_script_nameUse the
update-rc.dcommand to add the script to the system's startup itemssudo update-rc.d your_script_name defaultsEnable auto-start using the
systemctlcommandsudo systemctl enable your_script_nameReboot the development board to verify that the auto-start service runs correctly
systemctl status your_script_name.service
2. Add to the rc.local Service
rc.local is a system service used to automatically execute scripts or commands during system boot. This service is automatically invoked at system startup and executes user-specified scripts or commands after the system has finished booting, enabling custom configurations or operations at boot time.
In earlier Linux distributions, rc.local was the last service executed by default during the system boot process. With the widespread adoption of systemd, rc.local is now considered a legacy system service.
You can implement this by adding your startup command at the end of the /etc/rc.local file (edited via sudo vim /etc/rc.local), for example:
xxxxxxxxxx## rc.local#re# This script is executed at the end of each multiuser runlevel.# Make sure that the script will "exit 0" on success or any other# value on error.## In order to enable or disable this script just change the execution# bits.## By default this script does nothing.# Insert what you needexit 0