网上一搜一堆,居然被这种配置卡了一个小时,最后选择了systemd
建个文件 我的叫 zjh.service
/usr/lib/systemd/system
[Unit]
Description=zjh
[Service]
Type=oneshot
ExecStart=python /home/pi/Desktop/python/wifiserver.py &
[Install]
WantedBy=multi-user.target
systemctl enable zjh.service 即可
手动启动|停止 systemctl start|stop zjh.service
手动启不来就说明有问题了
systemctl status zjh.service 可以查查什么情况
重新配置后记得
systemctl daemon-reload
关闭服务
systemctl disable zjh.service