Monitoring files and directories
How to change editor for “systemctl edit command”.
Add to .bashrc / .zshrc:
export SYSTEMD_EDITOR=vim
Add to /etc/sudoers:
Defaults env_keep += "SYSTEMD_EDITOR"
Get / set default target when booting up:
$ systemctl get-default
$ systemctl set-default ...target
Create a new service:
sudo systemctl edit --force --full new.service
Limit CPU usage for user:
sudo systemctl set-property user-1001.slice CPUQuota=10%
sudo systemctl daemon-reload
Limit IO read rate to 1MB/sec for user:
sudo systemctl set-property user-1001.slice BlockIOReadBandwidth="/dev/sda 1M"
sudo systemctl daemon-reload
journald log files:
- transient in /run/log/journal/
- persistent in /var/log/journal/ (create directory to enable)
journald log entries since last boot:
journalctl -b