ubuntu server restarting instead of shutting down

Whenever I try to shutdown my pc by using sudo shutdown -... now (it doesn't matter what I fill in for the ...), it always shutdowns down for about 3-4 seconds, and than just powers up again. I'm sure WOL is disabled, and just to be sure I tested it with ethernet cable unplugged.

It's a fresh install of ubuntu server 14.04. It's also a new pc so I do not have any prior experience with it.

Any help would be very much appreciated


Just had this problem with 14.04 on a Gigabyte GA-MA78GM-S2H based desktop. Tried all the BIOS settings I've seen suggested around the web with no luck.

Thought it might be a USB related wake. Used non USB mouse and keyboard and problem solved.

Also USB keyboard adapter will work, but not one for the mouse, which is a little odd.