0

I understand that -p stands for power off.

The man page says:

-p, --poweroff

       Power-off the machine, regardless of which one of the three
       commands is invoked.

But exactly what does it do in reboot?

When tried both reboot and reboot -p in a RHEL 7 machine, I failed to find any appreciable difference.

3
  • A related question is unix.stackexchange.com/questions/195898 .
    – JdeBP
    Commented Aug 21, 2017 at 18:23
  • @JdeBP An excellent resource. And a must read. However, it does not answer my question.
    – Masroor
    Commented Aug 22, 2017 at 0:17
  • 1
    Which is why it is a question comment rather than an answer and is talking about related rather than duplicate questions.
    – JdeBP
    Commented Aug 22, 2017 at 7:57

1 Answer 1

1

The documentation is wrong. As others have pointed out: halt, reboot and poweroff are all symlinked to systemctl. That program first looks at the name it was invoked from and sets the action it is going to take (one of halt, reboot or poweroff). It then parses its arguments one by one to see if any of them override the default. However, looking at the source code, a poweroff option can not override anything when the current action is reboot.

reboot --halt --poweroff will power off the machine though, because when systemctl parses the final argument the current action is set to halt (from the previous argument).

1

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .