I have a systemd service configure like so:

Description=cprev agent



I install the service like so:

rsync "$PWD/systemd.service" "$HOME/.config/systemd/user/cprev.agent.service"
systemctl --user daemon-reload
systemctl --user enable cprev.agent.service
systemctl --user restart cprev.agent.service

I can tail the logs for my service using:

journalctl -f --user -u cprev.agent.service

my question is - do I need to manually truncate the logs for my service so they don't fill up, or does systemd manage the logs for me? If it manages for me, how does it work?


According to the systemd documentation, the logs kept by journald default to a size limit of 15% of disk capacity or 4GB, whichever is smaller. If /var is not mounted, not writable, or /var/log/journal does not exist, journald logs will only be stored in volatile memory (/run/log/journal.)

If your service creates log files of its own outside the systemd journal, you'll need to create a logrotate entry to manage them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.