写好的 .sh 文件放到目录 /etc/profile.d/ 下,系统启动后自动执行目录下全部shell脚本
例如:
#!/bin/sh #description: 开机自启动脚本 # 执行后台服务启动
linux 添加开机启动
原文:https://www.cnblogs.com/ludada/p/14335750.html