Disclaimer
This information HAS errors and is made available WITHOUT ANY WARRANTY OF ANY KIND and without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. It is not permissible to be read by anyone who has ever met a lawyer or attorney. Use is confined to Engineers with more than 370 course hours of engineering.
If you see an error contact:
+1(785) 841 3089
inform@xtronics.com
Systemd Cheatsheet
Basic Commands
Good news - tab complete works here! new
- start and stop service - reload - reloads config only - not all services have this option
$ systemctl {start | stop | restart | reload} daemon.service
- List services (this is dumb - too long to type - probably want to alias this in .bashrc -- or get the bugs out of bash-complete (they did))
$ systemctl list-unit-files --type=service
- Enable service (default run levels)
$ systemctl {enable | disable} daemon.service
$ systemctl status daemon.service
$ systemctl { poweroff | reboot }
Advanced
- Show properties of one or more units - most often you would use status instead
$ systemctl show daemon.service
- List or cancel jobs - good to stop a hung bug
$ systemctl {list | cancel}-jobs
Debug commands
- Get a good idea if everything started right or not - think of a log of systemd
$ journalctl -alb
- Find what is slowing boot up
$ systemd-analyze
Startup finished in 2.974s (kernel) + 18.109s (userspace) = 21.084s
$ systemd-analyze blame
- prints a list of all running units, ordered by the time they took to initialize.
$ systemd-analyze plot
- prints an SVG graphic detailing which system services
have been started at what time, highlighting the time they spent on
initialization.
$ systemd-analyze plot
- may be used to determine system boot-up performance
statistics and retrieve other state and tracing information from the
system and service manager.
$ systemd-analyze
- prints the time spent in the kernel before userspace
has been reached, the time spent in the initial RAM disk (initrd) before
normal system userspace has been reached, and the time normal system
userspace took to initialize.
Systemd services
- systemd-timesyncd.service
- Edit /etc/systemd/timesyncd.conf if you want to point at your
own time server - the keyword Servers needs a Capital 's' and the s at
the end.
- This service synchronizes the local system clock with a
Network Time Protocol Server(s). If you want to run your own time server
install ntp.