I have a Python program that I start on boot with a service in systemd. It works fine until Unix tries to rotate the system log file, and I get an error: "Journal has been rotated since unit was started. Log output is incomplete or unavailable." (systemctl status) The Python program is dead, and if I reboot, the PI won't come back up to GUI. I have found that if I restart logging, then I can reboot without corruption. (sudo service rsyslog restart). The Python program has limited print statements, so the log file data size should not be too big. what do I need to change to keep the rsyslog system from corrupting my system? Of course, the Python program runs fine from command line.
[Unit]
Description=flow system controller
[Service]
Environment=DISPLAY=:0
Environment=XAUTHORITY=/home/pi/.Xauthority
ExecStart=/usr/bin/python3 /home/pi/Documents/programs/flow_control.py
Restart=always
RestartSec=10s
KillMode=process
TimeoutSec=infinity
[Install]
WantedBy=graphical.target
sudo journalctl --no-pager -f
to see what is being logged in real time.Restart=always
? It never helps to "fix" a buggy service and may confuse systemd in case of restarting a buggy service. Also the other settings may confuse systemd. Why do you configure the service for graphical output when only using text output withprint
statements in python3?