Aloshi / EmulationStation

A flexible emulator front-end supporting keyboardless navigation and custom system themes.
MIT License
2.07k stars 904 forks source link

Shutdown fails to work on Ubuntu 14.04 / 14.10 #349

Open mdeguzis opened 9 years ago

mdeguzis commented 9 years ago

The shutdown or restart command fails with:

lvl2:   Added known joystick PLAYSTATION(R)3 Controller (64:D4:BD:BD:24:60) (instance ID: 0, device index: 0)
lvl1:   Shutdown terminated with non-zero result!

I am fine changing the line of code that I am guessing issues sudo shutdown -h now to something that works from the terminal. Is this something you can help me with? Maybe I am missing something, but nothing in the dotfile configs popped out at me right away.

Aloshi commented 9 years ago

The line you're looking for is on line 43 of es-core/src/platform.cpp. I'm guessing this is a permissions issue. I have no idea what the "proper" way to ask the system to shut down is on Linux as a non-superuser.

mdeguzis commented 9 years ago

ok I will take a look at that line and see what I can come up with. What I will likely do is add my user to the sbin reboot and shutdown commands (possibly) in the sudoers file. Either that, or come up with some kind of hack.

Something akin to:

user ALL=(ALL) NOPASSWD: /sbin/poweroff, /sbin/reboot, /sbin/shutdown

Not sure if there is a safer way, but only allowing a specific user allowance to shutdown and reboot seems to be the least of the methods I have seen. I'd rather not set the suid on /sbin files.