Prevent frontend from resurecting when the database is inaccessible #95
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am using MythTV version 31 installed on Xubunutu 21.04 or 20.04 via the mythbuntu ppa.
When I launch the frontend without the backend running, it displays the loading bar, but when I try to exit, either before or after it times out, it thinks the frontend has crashed, so it relaunches. This obviously creates an inescapable loop, which is annoying.
Killing mythfrontend via xfce4-taskmanager does break the loop, but oddly mythfrontend.real doesn't show up in xfce4-taskmanager while gnome-system-monitor shows both.
Adding exit code 130 to the list in the script breaks the loop. Exit code 130 is GENERIC_EXIT_NO_MYTHCONTEXT (https://github.com/MythTV/mythtv/blob/master/mythtv/libs/libmythbase/exitcodes.h ), which is a result of exiting the GUI startup screen (see mythcontext.cpp MythContextPrivate::FindDatabase() which returns false, causing MythContextPrivate::Init() to return false and thus MythContext::Init() to also return false, finally causing mythfontend to return 130 (https://github.com/MythTV/mythtv/blob/4eaa9cdbad0552d61f71a48019cbc6f9b1a14209/mythtv/programs/mythfrontend/main.cpp#L1896 )
GENERIC_EXIT_SOCKET_ERROR 135, may also need to be ignored based on its use in mythcontext.cpp.
Perhaps, abandoning the auto-restart entirely is a better option.
Alternatively, mythtv.desktop could be modified to call mythfrontend without the --service parameter.