在我的 systemd 服务中,我经常append
将日志附加到现有的日志文件:
[Service]
Type=idle
Restart=always
RestartSec=6
EnvironmentFile=/home/rock64/.config/systemd/user/photon_uploader.env
ExecStart=/usr/bin/python3 /usr/local/iot/home_iot/tcpserver.py
StandardOutput=append:/var/log/user/photon_uploder.log
StandardError=append:/var/log/user/photon_uploader_error.log
TimeoutStopSec=5
但服务因此错误而失败。
Nov 24 12:22:29 rockpro64 systemd[1336]: /home/rock64/.config/systemd/user/photon_uploader.service:16: Failed to parse output specifier, ignoring: append:/var/log/user/photon_uploder.log
Nov 24 12:22:29 rockpro64 systemd[1336]: /home/rock64/.config/systemd/user/photon_uploader.service:17: Failed to parse output specifier, ignoring: append:/var/log/user/photon_uploader_error.log