Author Topic: [Done] Shutdown/Sleep/Hibernate/Restart from server from the Web UI  (Read 2402 times)

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
My file server is not a 24/7.

I use the WOL feature of my router to wake up my server...

Once I have completed my file transfers, backups, etc... I will possibly have a look on tRaid via the Web UI and would love to have a menu to Shutdown/Sleep/Hibernate/Restart the server. Ex.: via a right-click on the host.

Is this something possible. Nowadays, I am using Shutdown or PsShutDown (from SysInternal) to remotely turn off my server (only works if UAC is disabled!).

V.
« Last Edit: November 19, 2013, 10:38:43 am by vletroye »

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: Shutdown/Sleep/Hibernate/Restart from server from the Web UI
« Reply #1 on: October 22, 2013, 05:42:44 pm »
Done. :)

Sleep state is not supported due to the remote nature (local user interaction would be necessary to bring the system back up).
However, users can now reboot or shutdown managed hosts from the Web UI.
If the managed host and the Web UI are on the same machine, obviously shutting down will cut you off completely. So, use with care.

WOL has been implemented too and you must configure your remote host system to support it. Once again, the Web UI and the managed host have to be separate machines for this to work.

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Re: Shutdown/Sleep/Hibernate/Restart from server from the Web UI
« Reply #2 on: October 23, 2013, 12:00:18 am »
Great 8)
And implemented so quickly...

Thx!

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Re: [Done] Shutdown/Sleep/Hibernate/Restart from server from the Web UI
« Reply #3 on: November 18, 2013, 03:47:52 pm »
It seems that tRAID's "shutdown" menu is doing a complete power-off.
After such a "shutdown" I can't WOL my server anymore :/

I don't know how you did implement it ?
I usually using the command dos "shutdown /t 0 /s" and can next WOL the machine...

But using the Win32 API, there are a lot of options:
rundll32.exe user.exe,ExitWindows [Fast Shutdown of Windows]
rundll32.exe user.exe,ExitWindowsExec [Restart Windows]
rundll32.exe shell32.dll,SHExitWindowsEx n

where n stands for:

0 - LOGOFF
1 - SHUTDOWN
2 - REBOOT
4 - FORCE
8 - POWEROFF
(can be combined -> 6 = 2+4 FORCE REBOOT)

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: [Done] Shutdown/Sleep/Hibernate/Restart from server from the Web UI
« Reply #4 on: November 18, 2013, 08:30:35 pm »
Err... you guys requested a complete power off. I believe it was NLS who actually argued that it should be a complete power off.

Offline vletroye

  • Hero Member
  • *****
  • Posts: 714
  • Karma: +7/-0
    • View Profile
Re: [Done] Shutdown/Sleep/Hibernate/Restart from server from the Web UI
« Reply #5 on: November 19, 2013, 02:23:05 pm »
 :-[ I am the guilty one... I said "power off".... because to my knowledge, the MB of my server supported to be waked-up from poweroff..
But it was not working anymore... and I though I was wrong regarding the difference between shutdown and poweroff and the support offered by my MB...


But it was such a mess last week on my various PC (I changed a lot at the hardware level, had issues with memory modules, with SSD, with restore of disk, etc... ...)  that I forgot I had reset the bios of my server => feature Wake-on PCI was disabled :(

I have just re-enabled that feature and will re-test your "shutdown" menu as soon as I have reactivated tRAID...

Sorry, I do too much in parallel  :-[
Such as testing several new IP camera on my Synology, testing a Samsung SSD 840 versus two SSD Kingston Hyperx in RAID 0 (Samsung win :p ), taking care of the kids (my wife is on a business trip), and I am sick since last week... Damn... I have sometimes the feeling that you could teach me something about time and priorities management  :D

Offline Brahim

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 8,547
  • Karma: +204/-16
    • View Profile
Re: [Done] Shutdown/Sleep/Hibernate/Restart from server from the Web UI
« Reply #6 on: November 20, 2013, 04:15:40 am »
One word: efficiency.
Necessity requires it. At least, it does in my life. ;)

Yeah, I was confused to as most hardware that do a complete power off require a button push or a physical switch.
This is not something usually done in the OS or else those that rely on IPMI or WOL would get themselves in trouble.