I have a Dell PowerEdge 1850 running Ubuntu in my basement, primarily running a Minecraft server. Leaving it on all the time is a waste of money, and it makes noise at night, so I typically turn it on during the day and turn it off before night, unplugging it when off because the fans run even when shut down.

What I want to do is possibly eventually wire a switch, hooked up to the server's power cord, to elsewhere in the house (i.e. near my computer). This way I could simply flip the switch, wait for it to boot, and then VNC into it. When I'm done, I'd stop the Minecraft server, shut Ubuntu down, and flip the switch off again.

Currently, however, I can't do this. The BIOS has an option to resume its last state when plugged in, but if I shut down Ubuntu prior to unplugging it, it will not turn on and boot automatically when it is plugged in again, as its last state was having been shut down.

Is there any way I can have it automatically turn on, even when I had previously shut down the machine? Alternatively, is there a safe way to kill Ubuntu by unplugging it to simulate the "AC power failure" that the BIOS option is designed for?

  • Maybe Wake-On-Lan would help: help.ubuntu.com/community/WakeOnLan. Mar 9 '14 at 21:06
  • Will WoL work after it is unplugged and plugged back in?
    – Roadsguy
    Mar 10 '14 at 13:16
  • The network adapter draws a small amount of power from the +5VSB (+5V standby) output of the power supply so than it can react to WoL events. You may need to enable it in the BIOS - that's covered in the article I linked to. Mar 10 '14 at 17:14

Firstly, a computer correctly shutted down shouldn't have any fan running, but it's maybe a specificity of this server, I don't know.

Secondly, since there is "an option to resume its last state when plugged in", isn't there anything to turn it on after power loss ? It's a feature often present on PC's BIOS. There are also other features as "alarm" which turn on the PC at a defined hour, or turn it on pressing a key on the keyboard.

Also, Andrew Morton is talking about WoL which can be a good solution too.

Finally, to answer your question, if you want to stop Ubuntu but don't turn of the computer, halt command should do the trick if it exists in Ubuntu. On distribution with systemd, to power off the computer you've to use systemctl poweroff, which will halt the system then power off the machine by ACPI. Using systemctl halt will only halt the system. With that, Ubuntu would be correctly stopped, but not the machine, so if there is a power loss, the last state would be "powered on" and it will boot automatically.

PS : I don't know how minecraft servers work, but using VNC isn't really designed for managing a real server like this, running GNU/Linux. We more often use SSH which is somewhat more convenient, use less bandwith and system resources, and doesn't require a graphical interface.

  • When I got the machine and plugged it in, the fans started. When I turned it on, the fans got louder and the machine actually did stuff, so I guess it's a specific feature to this server. ---- That option is labeled as "Action after power failure" (something like that). Unplugging it is of course power failure. I found no option to always turn it on after power loss. ---- WoL might be the trick if it works after complete power loss and not just shut down/sleep mode.
    – Roadsguy
    Mar 10 '14 at 13:20
  • As for stopping Ubuntu without shutting down, that might do it. I assume that unplugging it then won't cause problems because the OS is stopped, correct? ---- I haven't tried SSH yet, but VNC works for what I need it for. Essentially, the Minecraft server runs in the background, with a little console window with a log, and a field for entering the in-game commands. Often, all I need to do is start it or run /stop, so the visual lag isn't much of a problem. (Especially since I can close it without losing access to the console, unlike the Win7 RDP to xrdp connection I previously used.)
    – Roadsguy
    Mar 10 '14 at 13:23
  • As for WoL working after power failure, it might in fact not work since the network interface may be completely stopped. Ethernet card should be still able to handle packets for that. But the only way to know is to try it. And yes, no problem to unplug power cord if the OS is correctly stopped. Only that your server may fill his event log with power failure, but it shouldn't be a problem. If you remember old AT PC before 1996, it worked that way. You had to manually switch off the power supply to power off the PC after the OS was shutted down.
    – piernov
    Mar 10 '14 at 18:11
  • Just tried out code halt, and it works perfectly. Ubuntu shuts down, but the machine stays running, so that you have to switch it off manually. Doing this by unplugging will make it automatically boot the next time. I'm still going to try WoL to see how that works.
    – Roadsguy
    Mar 10 '14 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.