Skip to content

Latest commit

 

History

History
68 lines (68 loc) · 1.84 KB

systemd.md

File metadata and controls

68 lines (68 loc) · 1.84 KB
tags
tools

runtime

hostnamectl

shows info similar to lsb_release

systemctl

conveniently create drop-in files:

# edits /etc/systemd/system/unit.service.d/override.conf
sudo systemctl edit unit

journalctl

https://gist.github.com/sergeyklay/f401dbc8286f732783e05072f03ecb61

# tail logs:
journalctl -f
# view logs for specific unit:
journalctl -xe -u ssh
# kernel messages (-k), scrolled to bottom (-e):
journalctl -k -e

networkctl

manage systemd-networkd network configuration

Migrate from NetworkManager

  1. install packages:
    # systemd-networkd is available in the default package "systemd" in Debian
    # systemd-resolved is a separate package:
    sudo apt-get install systemd-resolved
  2. create basic network configuration for networkd:
    # /etc/systemd/network/lan0.network
    [Match]
    Name=eth0
    # or using stable interface name (ID_NET_NAME in udevadm info /sys/class/net/eth0)
    #Name=whatever it writes
    [Network]
    DHCP=yes
    # add search domains
    #Domains=lan
    [DHCPV4]
    UseDomains=yes
  3. disable NetworkManager and enable networkd/resolved
    sudo systemctl stop NetworkManager
    sudo systemctl disable NetworkManager
    sudo systemctl enable systemd-networkd
    sudo systemctl enable systemd-resolved
    sudo systemctl start systemd-networkd
    sudo systemctl start systemd-resolved
  4. reboot and hope it works
  5. check the systemd units, who need to wait for network to be up and running, with networkd they need following unit config:
    [Unit]
    Requires=network-online.target
    After=network-online.target
  6. if it works, remove NetworkManager:
    sudo apt-get purge network-manager
    sudo apt-get autoremove

machinectl

manage systemd-nspawn containers