Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/284.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 服务在使用SystemMd和Raspberry Pi一段时间后停止发送http请求_Python_Raspberry Pi_Systemctl - Fatal编程技术网

Python 服务在使用SystemMd和Raspberry Pi一段时间后停止发送http请求

Python 服务在使用SystemMd和Raspberry Pi一段时间后停止发送http请求,python,raspberry-pi,systemctl,Python,Raspberry Pi,Systemctl,我有一个服务,当raspberry启动时,它执行一个python程序,我使用systemMd来完成。问题是,过了一段时间,这个服务就会停止向我的服务器发送数据。我已经尝试单独运行python脚本,一切正常,问题发生在我使用systemMd时 下面是我的启动脚本 [Unit] Description=MyprogramName After=network.target [Service] ExecStart=/usr/bin/python3/src/main.py WorkingDirector

我有一个服务,当raspberry启动时,它执行一个python程序,我使用systemMd来完成。问题是,过了一段时间,这个服务就会停止向我的服务器发送数据。我已经尝试单独运行python脚本,一切正常,问题发生在我使用systemMd时

下面是我的启动脚本

[Unit]
Description=MyprogramName
After=network.target

[Service]
ExecStart=/usr/bin/python3/src/main.py
WorkingDirectory=/home/pi/MyprogramName/
StandardOutput=file:/home/pi/output.log
StandardError=inherit
Restart=always
User=root

[Install]
WantedBy=multi-user.target