Both reboot and poweroff are mapped to /bin/systemctl
, how does systemctl
control shutdown and restart. When entering reboot or poweroff, how does systemctl
get which command should be executed?
It looks like both reboot and poweroff are linked to /bin/systemctl
➜ /usr/bin file /usr/sbin/reboot
/usr/sbin/reboot: symbolic link to /bin/systemctl
➜ /usr/bin file /usr/sbin/poweroff
/usr/sbin/poweroff: symbolic link to /bin/systemctl
➜ /usr/bin
➜ /usr/bin
➜ /usr/bin
➜ /usr/bin uname -a
Linux mi-OptiPlex-7080 5.15.0-76-generic #83~20.04.1-Ubuntu SMP Wed Jun 21 20:23:31 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
➜ /usr/bin