Shutdown vs poweroff Command Line


New to the forum and greatly enjoying my 1 week old MBL 2TB. Got it all setup nicely and working great. Question:

I would like to shutdown nicely the unit via the command line, however, I see there is a shutdown as well as a poweroff command. What is the difference? Which one is recommended? Also, any recommended parameters?

“poweroff” is a symlink to “halt.”

“halt” actually calls “shutdown” in most circumstances (probably all circumstances as it relates to the MBL, because the MBL is always in runlevel 1 or 2  (1 during parts of the bootup and shutdown, and 2 in normal running condition.)

So in other words, shutdown,  halt and poweroff are equivalent.

1 Like

well, tested it yesterday and got the following:

Shutdown: A message saying the unit was going down for maintenance but that was it, never went down. SSH and shares were accessible still.

Poweroff: Now this DOES work.

I also tried “shutdown 14:00” in order for the unit to shutdown at 2pm, no luck, same message as earlier. Will have to play with more shutdown options I guess.

I think you might need the -h switch with the shutdown command.

1 Like

Thank you!

The following worked as expected:

shutdown -h 22:00


Have WD Sharespace setup anyway quite similar to MBL.

Below just to share my experience.

Have written a bat file to be triggered by UPS agent software Winpower (UPS connected to W7 desktop) on power failure.

Initially used only command poweroff but realized that pressing power off button or shutting down NAS over web GUI acted differently, blue lights blinking for some time before actual poweroff triggered.

Quite obvious a set of actions performed before raw poweroff (unmounting of drives etc.).

Googled a lot and still no answers.

Anyway in NAS /etc directory there are shutdown and reboot scripts, instead of plain poweroff used “/etc/rc.poweroff” and voila clean shutdown works like a charm.

@echo off
C:\PATH TO FILE\plink.exe root@IPADDRESS_OF_NAS -pw welc0me /etc/rc.poweroff
@echo on

Had one more issue before getting everything running.

Could run my bat file from windows but on power failure NAS did not shut down.

Look at services, find UPS related ones and change Log On As (by default same is Local System) to user who has appropriate rights (administrator for example).