Systemd

1. Configuration

  
$ man service.unit

$ apropos systemd
  

2. systemctl

  
$ systemctl list-units

$ systemctl list-unit-files
  
  
$ systemctl status rsyslog

$ systemctl show rsyslog
  
  
$ systemctl start rsyslog

$ systemctl stop rsyslog

$ systemctl restart rsyslog
  
  
$ systemctl enable rsyslog

$ systemctl show rsyslog
  

3. systemd-analyze

  
$ systemd-analyze critical-chain

$ systemd-analyze critical-chain rsyslog

$ systemd-analyze blame
  

4. journalctl

  
# list previous boots and timestamps.
$ journalctl --list-boots

# show errors of previous boot.
$ journalctl --boot=-1 --priority=err
  
  
$ journalctl -u docker

# live log
$ journalctl -fu docker
  

5. systemd-run

  
$ systemd-run --unit=myservice --description='My Service' ping google.com

$ systemctl status myservice

$ systemctl stop myservice
#     after stop, the unit disappears