0
Journalctl似乎在跳过相应服务输出的进程的某些输出。这是怎么发生的?Systemd丢弃stdout的随机数
这里有一个小例子:我有叫tester.py
import time
count = 0
while True:
time.sleep(.001)
count += 1
print count
下面的脚本和我有以下服务称为tester.service
[Unit]
Description=lots of output
After=network.target
[Service]
User=django
Group=django
WorkingDirectory=/home/django
ExecStart=/usr/bin/python -u tester.py
Restart=always
RestartSec=3
[Install]
WantedBy=multi-user.target
运行sudo systemctl start tester
和等待几秒钟后,然后我运行sudo journalctl -u tester
。
我注意到输出跳过了大块的数字。例如,下面是摘录:
Oct 05 23:44:00 staging python[23185]: 999
Oct 05 23:44:00 staging python[23185]: 1000
Oct 05 23:44:00 staging python[23185]: 1001
Oct 05 23:44:29 staging python[23185]: 26829
Oct 05 23:44:29 staging python[23185]: 26830
Oct 05 23:44:29 staging python[23185]: 26831
Oct 05 23:44:29 staging python[23185]: 26832
Oct 05 23:44:29 staging python[23185]: 26833
包括您正在使用的'systemd'版本。 –
如果你看完整的'journalctl'输出,那里还有差距吗? –
哦,我的天哪,它的速度有限!没有任何参数的journalctl显示'Suppressed xxx messages from/system.slice/tester.service' ..默认情况下是每30秒1000条消息。谢谢@MarkStosberg – theicfire