Page 1 of 1
Leanfront idle for backend shutdown? [solved]
Posted: Sun Feb 07, 2021 1:39 am
by Linuxgrrl
Hi,
I’ve been running Leanfront on a Fire Stick 4K and it’s really wonderful. It seamlessly handles all of the file formats that I’ve thrown at it. Unlike kodi it can jump and ff quickly with no hiccups, and live tv works great.
My backend no longer goes to sleep, though, and I think it’s because it views leanfront as a connected client even after I leave it and return to the main fire stick menu using the back key.
I tried forcing Leanfront to quit via adb, but that corrupted some MySQL tables so I won’t be doing that again. What is the correct way to handle this?
Re: Leanfront idle for backend shutdown?
Posted: Sun Feb 07, 2021 2:41 am
by jfabernathy
I have seen over the years a number of problems posted that were related to the backend going to sleep. I've rarely had a Linux system come out of Sleep correctly 100% of the time. So I never use sleep. In fact my backend/NAS server has not been off for at least a year. If my math is right my backend cost me $0.26/day in power.
Re: Leanfront idle for backend shutdown?
Posted: Sun Feb 07, 2021 2:58 am
by bill6502
Try:
mythbackend --setverbose idle (on a running backend).
Look in the backend logs for a message containing:
Code: Select all
Blocking shutdown because of delay request from external application
mythbackend --setverbose idle:notice turns off the additional logging.
Leanfront has code that keeps the backend up while its running. It sends a
Services API message periodically that delays shutdown 5 minutes. I'd be sure
Leanfront has exited normally and wait 5 minutes.
mythshutdown --check may
help as well (if there are other things holding the backend up).
Re: Leanfront idle for backend shutdown?
Posted: Sun Feb 07, 2021 12:22 pm
by Linuxgrrl
jfabernathy wrote: ↑Sun Feb 07, 2021 2:41 am
I have seen over the years a number of problems posted that were related to the backend going to sleep. I've rarely had a Linux system come out of Sleep correctly 100% of the time.
Fair enough. But you’ve gotta admit, when it *does* start and stop on cue, you feel pretty smart though right?
I know I do.
mythbackend --setverbose idle:notice turns off the additional logging.
Leanfront has code that keeps the backend up while its running. It sends a
Services API message periodically that delays shutdown 5 minutes. I'd be sure
Leanfront has exited normally and wait 5 minutes
I will check the log message when my family wakes up. But I think my problem is more basic. When I ran the adb equivalent of “ps aux”, it showed leanfront as still running even after I exited using the back key. Is there a quit button somewhere that I am not seeing?
Re: Leanfront idle for backend shutdown?
Posted: Sun Feb 07, 2021 2:44 pm
by Linuxgrrl
Look in the backend logs for a message containing:
Code: Select all
Blocking shutdown because of delay request from external application
Confirming, yes, I do have that message in my log. Is there a way to fully close / shut down Leanfront when I'm not using it?
Re: Leanfront idle for backend shutdown?
Posted: Sun Feb 07, 2021 4:18 pm
by pgbennett
If you repeatedly press return until it goes away, or press the home key, it is effectively shut down and will not keep the backend awake.
Leanfront will not send the keep awake messages to mythbackend when leanfront is not visible on screen. If there is some situation where it is doing that, please let me know. (Open a ticket in github).
Also if you have your TV CEC mode set to power off external devices when powering off or similar setting, when you power off the TV, leanfront will be sent to background, stopping the keep awake messages.
Please make sure you have the latest version of leanfront, as there were some changes recently in the way the wakeup messages are sent.
If you look at the mythbackend log, every 15 minutes on the 15 minute interval, it puts out a message as to why it is not shutting down. This will tell you what is really happening.
Note that in Android, applications that end are still "running" and will only be removed from memory when android needs the memory. This is not a problem, it is the way it is designed to work.
Re: Leanfront idle for backend shutdown?
Posted: Mon Feb 08, 2021 5:10 pm
by Linuxgrrl
Thank you for that explanation. I'm not sure what I was doing wrong before, but I was finally able to pry my family members off watching Leanfront and give it another test. As of this morning, auto shutdown of the backend is working normally and wake-on-lan is working also.
I really appreciate all the effort that went into making this terrific software!
Re: Leanfront idle for backend shutdown?
Posted: Mon Feb 08, 2021 8:16 pm
by Steve Goodey
If you're happy with the fix could you possibly added [Solved] to the subject line in the first post?
Ta.