Get the App
SLTechnology News&Howtos  ›  Servers  › 

Linux add automatic startup script

Shulou Source: shulou.com Published: 2022-06-03 10:21:31 09月21日 Update

The file vim / etc/rc.d/rc.local# is the command or script for liunx to start and customize the script.

# as shown in the picture, I added a custom script on the last line. I suggest adding "&" after the script. The script is run in the background. If it is not run in the background, there is an endless loop in the script, and the opportunity is stuck in the endless loop.

Script content

# the script implements the function of listening to udp port 9 and executing the shutdown command when receiving messages.

Tags: Script background command that is loop run one line function content suggestion message file opportunity port as shown in figure custom monitor Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker macOS MySQL Shulou Information Redmi