Difference between revisions of "Systemctl"
Jump to navigation
Jump to search
↑ https://www.freedesktop.org/software/systemd/man/systemctl.html
↑ https://www.linuxtrainingacademy.com/systemd-cheat-sheet/
| Line 2: | Line 2: | ||
== Basic Usage == | == Basic Usage == | ||
| − | * <code>[[ | + | * <code>[[systemctl status]]</code> |
* <code>systemctl list-units</code> | * <code>systemctl list-units</code> | ||
** <code>systemctl list-units --all</code> | ** <code>systemctl list-units --all</code> | ||
Revision as of 08:35, 10 December 2019
systemctl command is used to control the systemd system and service manager.[1]
Basic Usage
systemctl statussystemctl list-unitssystemctl list-units --allsystemctl list-units --failedsystemctl list-units --type=service
- List services:
/systemctl list-unit-files/[2] - List services enabled:
systemctl list-unit-files --state=enabled - View status of a service:
systemctl status docker - Show properties:
systemctl show sshd.service - View dependencies:
systemctl list-dependencies sshd.service - Creating new services in:
/etc/systemd/system/https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/system_administrators_guide/sect-managing_services_with_systemd-unit_files systemctl -t mountsystemctl list-units -t mountsystemctl enable FS_UNIT_NAME.mountsudo systemctl enable --now snapd.socket
Activities
Basic
- Read systemd Cheat-sheet: https://www.linuxtrainingacademy.com/systemd-cheat-sheet/
- Enable or disable Automatic updates in your Ubuntu machine
Advanced
- Read Why are reboot, shutdown and poweroff symlinks to systemctl?: https://unix.stackexchange.com/questions/77029/why-are-reboot-shutdown-and-poweroff-symlinks-to-systemctl/77030#77030
- Create a service that restart on-failure. https://superuser.com/questions/507576/how-to-automatically-restart-a-linux-background-process-if-it-fails
See also
Advertising: