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?
Leanfront idle for backend shutdown? [solved]
Leanfront idle for backend shutdown? [solved]
Last edited by Linuxgrrl on Mon Feb 08, 2021 10:04 pm, edited 1 time in total.
- jfabernathy
- Senior
- Posts: 577
- Joined: Wed Feb 18, 2015 2:37 pm
- Location: Raleigh, NC
Re: Leanfront idle for backend shutdown?
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?
Try: mythbackend --setverbose idle (on a running backend).
Look in the backend logs for a message containing:
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).
Look in the backend logs for a message containing:
Code: Select all
Blocking shutdown because of delay request from external application
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?
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.jfabernathy wrote: ↑Sun Feb 07, 2021 2:41 amI 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.
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?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
Re: Leanfront idle for backend shutdown?
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?Look in the backend logs for a message containing:
Code: Select all
Blocking shutdown because of delay request from external application
Re: Leanfront idle for backend shutdown?
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.
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?
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!
I really appreciate all the effort that went into making this terrific software!
- Steve Goodey
- Moderator
- Posts: 219
- Joined: Fri Feb 07, 2014 6:30 pm
- Location: Colchester, England
Re: Leanfront idle for backend shutdown?
If you're happy with the fix could you possibly added [Solved] to the subject line in the first post?
Ta.
Ta.
Don't forget the Wiki.