[Chuanglong TL570x-EVM] Establish startup service - print helloworld
[Copy link]
[Preface] Some services or programs need to be automatically enabled when the computer is turned on, and they need to be added to the startup service. Today, according to the tutorial, we will show you how to print hello world when the computer is turned on.
1. Create a new helloword.sh file in the previous directory:
Enter the following:
Save and exit.
3. Create a service: Enter the file system "/lib/systemd/system/" directory and create a self-starting systemd service configuration file helloworld.service .
Enter the following:
Description is a brief description of the systemd service, ExecStartPre is the print information of the systemd service,
ExecStart is the command to start the current service.
Save and exit.
4. Enter the service enable command: systemctl -f enable /lib/systemd/system/helloworld.service
After restarting the Linux system, the systemd service will automatically execute the contents of the helloworld.sh script after it is started.
The system print information is shown in the figure below:
[Summary] I have learned three steps: creating a new startup file, creating a new startup service file, and taking effect on the service command.
|