Score:0

"shutdown" vs "reboot" on Debian

bd flag

A friend has lectured me I should use shutdown .. rather available reboot command available in Debian systems.

Is this reasonable and supported by facts rather than by fashion of making UNIX/Linux commands cryptic? I mean if reboot is there provided by Debian developers, shouldn't it stands to reason it's perfectly OK to use it?

Please advise.

vidarlo avatar
ar flag
Did he give you a reason?
bd flag
@vidarlo Except "you should use this and that flag to shutdown", no.
vidarlo avatar
ar flag
Use whatever you're comfortable with. Both seem to perform a clean reboot.
Score:2
tm flag

First things first, what these commands actually do:

  • Both commands are a symbolic link to systemctl, the command line utility of systemd.
  • You can simply verify this by executing ls -la /usr/sbin/shutdown and ls -la /usr/sbin/reboot
  • Thus, the commands are interpreted by systemd, which then decides the action to perform (among other tasks).
  • systemd is the init system that Debian uses and simply put, responsible for starting and stopping services, including invoking a shutdown and reboot
  • Shortly, both commands end up calling a specific systemd target, which in the end executes a system call. That's what defines what actually is happening.

Knowing this, both commands can lead to the very same targets and thus the very same kernel calls, doing the very same action. That fully depends on the command line options you use on these commands.

What does this mean for common cases?

  • Simple reboots are accomplished with shutdown -r and reboot. They lead to the same systemd target and therefore are doing exactly the same.
  • Shutdowns are accomplished with shutdown -h now or shutdown -P now. You cannot accomplish a shutdown with the reboot command to my knowledge, as the --poweroff switch is simply ignored when it is invoked through the reboot command

So, should you avoid the reboot command?

As shown both do their task. Depending on whether you want a shutdown or reboot, you use one of these commands with the appropriate options. There is no particular reason to specifically avoid the reboot command, as, in case of rebooting it does the very same thing as shutdown -r.

Source and more in depth description

You can read a more in-detailed description in "What is the difference between these commands for bringing down a Linux server?". It focuses on Red Hat Enterprise Linux, but as RHEL is using systemd just as Debian does, the explanations made there should be applicable to Debian as well.

Score:0
id flag

It's reasonable in the sense that reboot ends up calling shutdown afterwards anyway (unless you --force it), but unless you're working on some omega obsolete system, it's highly unlikely you will ever experience any performance impact from this.

Source: https://linux.die.net/man/8/reboot

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.