====== systemd ====== ^ Service/daemon handling ^^ ^ alte Befehle ^ systemd ^ | /etc/init.d/NAME start|reload|restart|stop oder service NAME start|reload|restart|condrestart|stop ggf. sind weitere Modi möglich oder einige Modi nicht möglich | systemctl start|reload|restart|condrestart|stop NAME.service | ^ Logging ^^ | journalctl -b ((vorher: dmesg [-T] )) | Bootmeldung | | journalctl -b -p err | Priorität Error oder seit dem boot anzeigen | | journalctl -p warning --since="2018-08-20 00:00:01" | Alle Meldungen mit warning oder höher seit dem 20.08.2018 00:00:01 | | journalctl -f | dem Systemprotokoll folgen | | journalctl -u SERVICE Alternativ einer bestimmen Binärdatei journalctl /usr/sbin/httpd | Nur die Logdateien eines bestimmten Dienstes zeigen | ^ Systemstatus ^^ ^ alte Befehle ^ systemd ^ | halt | systemctl halt | alts the system | | poweroff | systemctl poweroff | Powers off the system | | reboot | systemctl reboot | Restarts the system | | pm-suspend | systemctl suspend | Suspends the system | | pm-hibernate | systemctl hibernate | Hibernates the system | | pm-suspend-hybrid | systemctl hybrid-sleep | Hibernates and suspends the system | ===== Links ===== * [[http://linux.xvx.cz/2014/06/systemd-cheatsheet.html|systemd cheatsheet]] [[https://cdn.rawgit.com/ruzickap/linux.xvx.cz/gh-pages/files/systemd_cheatsheet/systemd_cheatsheet.pdf|PDF]] * [[https://wiki.debian.org/systemd|systemd - system and service manager]] * [[https://fedoraproject.org/wiki/How_to_debug_Systemd_problems|How to debug Systemd problems]] * [[http://major.io/2014/05/20/switching-to-systemd-on-debian-jessie/|Switching to systemd on Debian jessie]] ===== Komponenent von systemd ===== * [[https://wiki.ubuntuusers.de/systemd/systemd-analyze/|systemd-analyze]] * systemd-journald (Syslog) * systemd-resolved (DNS) * systemd-timesyncd (NTP) * systemd-timers (Cron-Ersatz, siehe //systemctl list-timers//) * andere Komponenten: * systemd-hostnamed * systemd-timedated * systemd-localed * systemd-logind * systemd-machined * systemd-importd ===== Konfiguration ===== ==== aktivierte unit-files anzeigen ==== systemctl list-unit-files | grep enabled ==== autostart ==== systemctl enable DIENST.service Created symlink from /etc/systemd/system/multi-user.target.wants/DIENST.service to /lib/systemd/system/DIENST.service. ==== geänderte unit files einlesen ==== systemctl daemon-reload ==== escaping in unitfiles ==== systemd-escape 'my string' [[https://www.freedesktop.org/software/systemd/man/systemd-escape.html|systemd-escape]] [[https://serverfault.com/questions/694151/how-to-escape-spaces-in-systemd-unit-files|How to escape spaces in systemd unit files?]] ===== Container systemd-nspawn ===== https://wiki.debian.org/nspawn https://blog.selectel.com/systemd-containers-introduction-systemd-nspawn/