Opened 4 years ago

Closed 4 years ago

Last modified 3 years ago

#13136 closed Patch - Feature (Won't Fix)

Frontend Startup Improvement

Reported by: Peter Bennett Owned by: Peter Bennett
Priority: minor Milestone: 30.0
Component: MythTV - General Version: Master Head
Severity: medium Keywords:
Cc: Ticket locked: no



I have a backend that is shut down when not in use. I have remote frontends that use the features in database setup and backend setup to wake the database and the backend when the frontend is started. This works in conjunction with the Frontend Startup window. The remote frontend machine is set to auto logon and autostart mythtv when the frontend machine is booted.

The Problem

The problem is that if I start up the remote frontend for maintenance or other reasons I do not want the backend to be automatically started. I would like an action on the remote frontend with the remote control to trigger the frontend startup, and that in turn should wake the backend.

mythwelcome does not help because mythwelcome needs the database running and connected in order to work.

The Proposed Solution

The solution is implemented by the attached patch. If you pass a parameter of --wait into mythfrontend, it will show the startup screen with a Start button and instructions to select Start to proceed with frontend startup. It does this without any access to database or backend. The Startup screen uses MythUI and the Start button can be selected using keyboard or remote. After invoking the Start button, normal startup including waking of the backend proceeds.

This can also be used on a combined frontend / backend like mythwelcome is used, to avoid the frontend starting if the backend is starting up to make recordings.

Attachments (1)

20170929_startup.patch (11.9 KB) - added by Peter Bennett 4 years ago.
Patch to implement this feature

Download all attachments as: .zip

Change History (7)

Changed 4 years ago by Peter Bennett

Attachment: 20170929_startup.patch added

Patch to implement this feature

comment:1 Changed 4 years ago by Mark Spieth

Is there some way to probe the backend without causing it wake up and then do this conditionally? I think WOL uses a specific packet so ping or just try to connect to the DB may do the job.

comment:2 Changed 4 years ago by Peter Bennett

Thank you for looking at this.

If I understand correctly you feel it would be better if the frontend starts up completely when the backend is already running, and goes into the startup screen if the backend is down. I think that could be done very easily, by suppressing wakeup until the user specifically selects "Retry" on the startup screen. It would go though an initial round of trying and failing to connect to the backend and then wait for the user to select one of the options such as Retry or Exit. Upon Retry the wakeup would be enabled.

In the case where the backend was already running, you would need to make sure the frontend idle timeout is set so that if you are using the frontend machine for something else mythfrontend can go into idle and the backend can shut down. When the frontend is idle and the backend shuts down, the frontend will theoretically wake the backend on any key stroke, however it can take many minutes to respond to the key stroke. That situation does not work well, due to the long timeouts involved. I tried and failed to find an easy solution to this.

I could add another startup option, for example --nowakeup, to implement this way of doing it. Do you think that is worthwhile?

comment:3 Changed 4 years ago by Mark Spieth

Depends on the use cases.

If you want MFE up without connecting to the backend then you need to be able to invoke this. If it doesnt matter if MBE is up then connect anyway. Is it also ok if the backend comes up while waiting, connect anyway? These sort of questions should guide the solution space.

Alternative is modify mythwelcome to do that. or both.

What sort of maintenance can you do on MFE without a backend?

Who is the end user? just you for a particular need?

Is complexity an issue? Then implement what you need and someone else may find it useful too. You can always tech debt/backlog the other ideas for later grooming.

sorry forgot to press submit :-(

comment:4 Changed 4 years ago by Peter Bennett

I am holding off on this for now, because the startup screen does not accept network remote commands, so that limits the usefulness.

comment:5 Changed 4 years ago by Peter Bennett

Resolution: Won't Fix
Status: newclosed

comment:6 Changed 3 years ago by Peter Bennett

Owner: changed from Peter Bennett to Peter Bennett
Note: See TracTickets for help on using tickets.