Systemd: Difference between revisions

From DWIKI
mNo edit summary
mNo edit summary
Line 48: Line 48:


  systemctl enable fstrim.timer
  systemctl enable fstrim.timer




= FAQ =
= FAQ =


==Fix journal size==
== Fix journal size ==
 
  journalctl --vacuum-time=10d
  journalctl --vacuum-time=10d
or
or
  journalctl --vacuum-size=1G
  journalctl --vacuum-size=1G


Line 65: Line 69:
 
 


 


== Systemd and DNS ==
== Systemd and DNS ==
Line 70: Line 75:
  resolvectl status
  resolvectl status


===Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.===
=== Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found. ===
 
Means systemd-resolved is not running
Means systemd-resolved is not running


Restart:
Restart:
Line 80: Line 85:
        
        


 


=== Add nameserver ===
=== Add nameserver ===
Line 124: Line 130:


  systemctl daemon-reexec
  systemctl daemon-reexec
==Status==
=== Active: inactive (dead) ===
parameter ActiveState would return inactive
SubState returns dead

Revision as of 14:55, 11 February 2022

 

Documentation

(Single user/emergency

Locations

/etc/systemd
/usr/lib/systemd/
/lib/systemd

 


HOWTO

Timers

man systemd.timer

List active timers

systemctl list-timers


List all timers

systemctl list-timers --all

Create timer

systemctl enable fstrim.timer


FAQ

Fix journal size

journalctl --vacuum-time=10d

or

journalctl --vacuum-size=1G

Analyze boot processes

systemd-analyze blame

 

 

 

Systemd and DNS

resolvectl status

Failed to get global data: Unit dbus-org.freedesktop.resolve1.service not found.

Means systemd-resolved is not running

Restart:

systemctl restart systemd-resolved
      
      

 

Add nameserver

Sacrifice a chicken

 

Flush caches

systemd-resolve --flush-caches

All status

systemctl status -a

syslog spam

https://psyq123.wordpress.com/2015/06/29/if-you-get-a-lot-of-logspam-from-systemd-in-your-varlogsyslog-this-might-help/

list available services

systemctl list-unit-files

or

systemctl list-units

 

normal interface names

net.ifnames=0

Show failed services

systemctl --failed

 

systemd: Started Session

Change loglevel to notice in /etc/systemd/system.conf

systemctl daemon-reexec

Status

Active: inactive (dead)

parameter ActiveState would return inactive

SubState returns dead