1
0
Fork 0
knowledge-base/KB/Linux/Server/systemd.md

32 lines
676 B
Markdown
Raw Normal View History

2022-09-04 12:54:22 +00:00
---
creation date: 2022-01-08
2023-11-23 13:37:11 +00:00
tags: [note,systemd,linux]
2022-09-04 12:54:22 +00:00
---
## Taming the journal's size
Systemd's system journal's size can go out of control. There are some things you can do to keep it in control:
```shell
journalctl --vacuum-size=512M
journalctl --vacuum-time=4weeks
```
## Forwarding the journal to /dev/tty12
**You really want this? It's basically a leak available with a shortcut.**
This is very simple. Just create the file `/etc/systemd/journald.conf.d/fw-tty12.conf` and fill it like this:
```shell
[Journal]
ForwardToConsole=yes
TTYPath=/dev/tty12
MaxLevelConsole=info
```
Then, restart the service:
```shell
systemctl restart systemd-journald.service
```