I understand that it reboot
is to restart the pc, while it systemctl reboot
is to do the same thing but with systemd, but I don't know what the difference is when using one or the other
I understand that it reboot
is to restart the pc, while it systemctl reboot
is to do the same thing but with systemd, but I don't know what the difference is when using one or the other
First I think you have to explain things that seem unrelated.
systemd , SysVinit are a set of daemons responsible for initializing an operating system and managing system processes after boot.
systemd , and others like upstart , etc, emerged as a replacement for SysVinit .
You can see that they are the first processes that are executed.
Both have programs (or symbolic links) to work with the management of the system processes. Shut down, stop, restart, system or cancel these tasks.
reboot
When programs like or were used on a system using SysVinit,poweroff
these were symbolic links to the programhalt
and made this program act differently depending on the name it had been invoked on. When they were called, the execution level ( runlevel ) was changed to 1, for single-user mode or maintenance level, and processes were run according to what was stipulated in their execution level scripts.Instead, on systems using systemd
systemctl
, the controlling program is usedsystemd
.Something analogous, to the symbolic links, happens with the program
poweroff
and others that are used to maintain a relationship with those of SysVinitThey are all symbolic links to the program
/bin/systemctl
(in the case of a system using systemd).Part of the above was to show that "shutting down" or "rebooting" the machine is a process that depends on a set of initialization programs (upstart, systemd, init, etc). So shutting down or restarting are tasks and concepts dependent on each management system.
Although the short answer would be that you use the command
readlink -f $(command -v reboot)
wherecommand -v programa
is a bash built-in that, among several utilities, allows you to display information on how the name of the program passed as a parameter is interpreted.readlink
is a program that resolves filenames or symbolic links, and with the parameter-f
or-e
follows each symbolic link to which the argument refers.