0

I have written a program that logs to stderr. I run it as a service with systemd. Here's the unit file:

[Unit]Description=Mi Scale TranslatorAfter=network.target[Service]Type=simpleRestart=alwaysExecStart=/root/miscale/miscale[Install]WantedBy=multi-user.target

Every couple of days the service stops working. When I check the status this is the output:

# systemctl status miscale● miscale.service - Mi Scale Translator   Loaded: loaded (/root/miscale.service; linked; vendor preset: enabled)   Active: inactive (dead)

I thoughtRestart=always would prevent exactly this, but apart from that there are also no logs:

# journalctl -u miscale-- Logs begin at Thu 2019-02-14 10:11:58 GMT, end at Sun 2022-12-04 20:18:38 GMT. ---- No entries --

I now restarted it withsystemctl start miscale and there are logs:

# journalctl -u miscale-- Logs begin at Thu 2019-02-14 10:11:58 GMT, end at Sun 2022-12-04 20:20:31 GMT. --Dec 04 20:19:17 raspberrypi systemd[1]: Started Mi Scale Translator.

But I'm sure when I check again in a few days, the service will be dead again and the logs will have disappeared.

Marcus Müller's user avatar
Marcus Müller
52.9k4 gold badges80 silver badges123 bronze badges
askedDec 4, 2022 at 20:28
AndreKR's user avatar
6
  • Maybe you have size limits for the journalctl. Check the file:/etc/systemd/journald.conf and search for the valueSystemMaxUse.CommentedDec 4, 2022 at 20:43
  • @EdgarMagallon There's a single section[Journal] in it and all settings includingSystemMaxUse are commented out.CommentedDec 4, 2022 at 20:45
  • Don't you have aTimer (systemd unit) or acron job which cleans the journal logs? Something likejournalctl --vacuum-size=100M is used to clear journal logs.CommentedDec 4, 2022 at 20:53
  • @EdgarMagallon It's a pretty much stock Raspberry Pi OS, I didn't configure anything. Nothing in/etc/crontab nor in/var/spool/cron.CommentedDec 4, 2022 at 21:02
  • I thinkRaspberry based Linux OS are configured by default to delete logs after certain time. Or maybesystemd are deleting the logs asthis answer said orthis anwer as well.CommentedDec 4, 2022 at 21:13

0

You mustlog in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.