Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603210 - media-tv/mythtv-0.28 Patch to prevent a remote frontend idlescreen (standby) from waking up the backend after the backend shuts down.
Summary: media-tv/mythtv-0.28 Patch to prevent a remote frontend idlescreen (standby) ...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-20 16:24 UTC by Norman Back
Modified: 2017-07-24 08:41 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Patch to implement controlled disable of WOL when idlesceen has focus. (idlescreen.patch,8.50 KB, patch)
2016-12-20 16:24 UTC, Norman Back
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Norman Back 2016-12-20 16:24:41 UTC
Created attachment 456884 [details, diff]
Patch to implement controlled disable of WOL when idlesceen has focus.

The idlescreen (standby) screen in mythtv-0.28 provides a very useful function that allows the backend to shutdown and keep the user informed about the state of the backend server. This works well on a combined master backend/frontend deployment but for remote frontends, the master backend is restarted, by the idlescreen updates, via WOL every time it shuts down (unless WOL is disabled for the master backend). 

This bug report describes an enhancement such that Wake-on-LAN (WOL) is disabled when the idlescreen has focus and the master backend has shut down. A patch is attached to implement this.

This patch updates mythfrontend/idlescreen.cpp, mythfrontend/backendconnectionmanager.cpp and libmythbase/mythcorecontext.cpp (plus associated .h files). The functionality of the frontend is unchanged unless the idlescreen is displayed. After the master backend has issued a SHUTDOWN_NOW event, further backend connection attempt from the idlescreen disable WOL. When the master backend restarts (to record etc) WOL is re-enable for the idlescreen.

Summary of changes:
mythfrontend/idlescreen.cpp
    Changes made to disable WOL when the master backend has announced it is 'shutting down now' and re-enable it after master backend restart.
    
    New events IDLE_SCREEN_LOADED and IDLE_SCREEN_DESTROYED sent on idlescreen creation and destruction.
    New parameter 'bool disableWOL' added to call of SafeConnectToMasterServer. When called set to m_disableWOL.
    Extra code in IdleScreen::customEvent to set m_disableWOL true on a SHUTDOWN_NOW event.
    Extra code in IdleScreen::customEvent to set m_disableWOL false on a RECONNECT_SUCCESS event.

backendconnectionmanager.cpp
    Changes made to enable detection of SHUTDOWN_NOW, IDLE_SCREEN_LOADED and IDLE_SCREEN_DESTROYED events and disabling of WOL during reconnect retries.
    
    New variable 'bool m_disableWOL' added to class Reconnect.
    New parameter 'bool disableWOL' with default value of false added to Reconnect.
    New variables 'bool m_frontend_idle' and 'bool m_shutdown_now'.
    Extra parameter 'bool disableWOL' add to calls of SafeConnectToMasterServer, set to true when both m_frontend_idle and m_shutdown_now are true.
    In BackendConnectionManager::customEvent additional code to catch IDLE_SCREEN_LOADED and IDLE_SCREEN_DESTROYED setting m_frontend_idle appropriately.
    Extra code in BackendConnectionManager::customEvent to set m_shutdown_now true on SHUTDOWN_NOW event.
    Extra code in BackendConnectionManager::customEvent to set m_shutdown_now false on RECONNECT_SUCCESS event.
    
libmythbase/mythcorecontext.cpp
    Changes made to allow 'bool disableWOL' to be passed to ConnectCommandSocket which implements WOL.
    
    Extra parameter 'bool disableWOL' with default value of false added to definitions of SafeConnectToMasterServer, ConnectToMasterServer, ConnectCommandSocket.
Comment 1 Norman Back 2016-12-20 16:26:22 UTC
This has been raised as mythtv bug #12960
Comment 2 Norman Back 2016-12-20 16:58:55 UTC
To benefit from this enhancement the mysql database must be on a different server to the master backend.
Comment 3 Pacho Ramos gentoo-dev 2017-07-24 08:41:57 UTC
This should be implemented upstream