Systemd is becoming the default on most distros Systemd is becoming the default in many distros, RHEL, CentOS, Ubuntu.
it offers a single command to manage your system, instead of switching between chkconfig
or running init scripts.
Systemd Service Commands
COMMAND | DESCRIPTION |
---|---|
systemctl stop service-name | systemd stop running service |
systemctl start service-name | systemctl start service |
systemctl restart service-name | systemd restart running service |
systemctl reload service-name | reloads all config files for service |
systemctl status service-name | systemctl show if service is running |
systemctl enable service-name | systemctl start service at boot |
systemctrl disable service-name | systemctl – disable service at boot |
systemctl show service-name | show systemctl service info |
systemctl -H target command service-name | run systemctl commands remotely |
Systemd Information Commands
Systemd commands that show useful system information.
COMMAND | DESCRIPTION |
---|---|
systemctl list-dependencies | show and units dependencies |
systemctl list-sockets | systemd list sockets and activities |
systemctl list-jobs | view active systemd jobs |
systemctl list-unit-files | systemctl list unit files and their states |
systemctl list-units | systemctl list default target (like run level) |
Changing System State
systemd reboot, shutdown, default target etc
COMMAND | DESCRIPTION |
---|---|
systemctl reboot | systemctl reboot the system |
systemctl poweroff | systemctl shutdown (power off the system) |
systemctl emergency | Put in emergency mode |
systemctl default | systemctl default mode |
##Systemctl Viewing Log Messages
COMMAND | DESCRIPTION |
---|---|
journalctl | show all collected log messages |
journalctl -u sshd.service | see sshd service messages |
journelctl -f | follow messages as they appear |
journelctl -k | show kernel messages only |