配置 及 打印日志
#!/bin/sh -x
#
# rc.local
#
# 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.
exec 1>/tmp/rc.local.log 2>&1
set -x
nohup /usr/bin/python3 /home/notcare/trigger.py &
exit 0
注意事项
1.脚本命令执行 最好全路径 添加执行权限
2.问题看启动日志
exec 1>/tmp/rc.local.log 2>&1
set -x