2017-10-05 6 views
0

Journalctlは、対応するサービスが出力しているプロセスの出力の一部をスキップしているようです。どうしたの?Systemdはstdoutのランダムな部分を削除します

はここで小さな例です:私はtester.py

import time 
count = 0 
while True: 
    time.sleep(.001) 
    count += 1 
    print count 
と呼ばれる次のスクリプトを持っていると私には、以下のサービスが sudo systemctl start testerを実行し、数秒待った後 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 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 
+0

あなたが使っている 'systemd'のバージョンを含みます。 –

+0

完全な 'journalctl'出力を見ると、そこにもギャップがありますか? –

+2

ああ私のおしゃべり、それはレート制限されている!引数のないjournalctlは、 '/ system.slice/tester.service'から' xxx messagesを抑制しました 'というメッセージを表示します。デフォルトは30秒間に1000メッセージです。ありがとう@MarkStosberg – theicfire

答えて

1

Systemdはあなたの出力を制限しています!デフォルトは、30秒間に1000行の出力です。これを変更することができます/etc/systemd/journald.conf

journalctlを単独で実行すると問題があることを確認できます。あなたはフォームのメッセージを見るでしょうSuppressed xxx messages from /system.slice/tester.service

関連する問題