notandy / ympd

Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS
http://www.ympd.org
GNU General Public License v2.0
515 stars 143 forks source link

Add a poweroff button #79

Closed meonwax closed 9 years ago

meonwax commented 9 years ago

Hi,

First of all: great project! Now a feature request by me:

It would be nice if you could implement a shutdown button to gracefully poweroff the Raspi. Of course the system user has to be privileged but that's only a configuration issue. Perhaps just call /sbin/poweroff or let the user configure the shutdown command himself (e.g. sudo /sbin/poweroff) with an appropriate sudoers entry.

That would enormously increase the lifetime of the filesystem.

What do you think?

ajs124 commented 9 years ago

I think this sounds like feature creep. Why does a webinterface for mpd need to be able to shut down your whole device? What does any of this have to do with the "lifetime of the filesystem"?

Ympd is also not exclusive to the raspberry pi, but probably runs on everything that's POSIX compatible.

meonwax commented 9 years ago

Every (POSIX compatible) system on which ympd is running on has to be shut down eventually. And when you run a filesystem that does not always sync will be in dirty state or at the worst will show data loss when the power is cut off abruptly.

I think a project like this could offer a solution for this with a config option. Would not be a big deal.

szymonkaliski commented 9 years ago

Hmm, "Every (POSIX compatible) system on which ympd is running on has to be shut down eventually" isn't this the case with all software? By this logic for example web browser should have shutdown button as well, right?

ghost commented 9 years ago

If such a feature had indeed a place in a media server, I'd expect to see it in mpd directly, not in one of its web frontend. Why not try the request directly in mpd? If it implements a shutdown API, then it will make more sense to expose it in ympd.

meonwax commented 9 years ago

I understand your arguments and agree with @hsoft that this may be a todo for mpd itself. I also found a neat workaround here that i will try to implement.

Thank you for your comments. I will close this issue.