Mythwelcome refuses shutdown

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
bhlevca
Newcomer
Posts: 6
Joined: Thu Sep 17, 2015 4:18 pm
Canada

Mythwelcome refuses shutdown

Post by bhlevca »

I have the same problem described here : http://www.gossamer-threads.com/lists/m ... ers/558970

Mythwelcome 'Suspending idle timer / Resuming idle timer' every 30 seconds, but sometimes loops through the 900 sec and starts again. sometimes is stuck and the countdown also does not happen.

Shutting down manually works but without manual intervention the box just stays on.

I tested manually the RTC clock wake up so I know that I don't have an issue with the hardware or RTC timer. It shuts down and wakes up properly whan doen direlcy as suggested at the MythTv ACPI site.

Waking to record also does not happen. I followed and doublechecked the settings from here :
https://www.mythtv.org/wiki/ACPI_Wakeup

I actually tried both the Desktop version and the one using mythwelcome. Same outcome: no shutdown no wake up.

I have Opensuse 13.2 which comes with version :

Code: Select all

MythTV Version : 9d871a9
MythTV Branch : tag: v0.27.3
Network Protocol : 77
Library API : 0.27.20140702-1
QT Version : 4.8.6
Options compiled in:
 linux release use_hidesyms using_alsa using_jack using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_firewire using_frontend using_hdhomerun using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcrypto using_libdns_sd using_libfftw3 using_libxml2 using_libudf using_lirc using_mheg using_opengl using_opengl_video using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xrandr using_xv using_mythlogserver using_bindings_perl using_bindings_python using_bindings_php using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2 using_libudf
Any help on how to debug what is going wrong is appreciated.

Thanks
Bogdan
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Mythwelcome refuses shutdown

Post by bill6502 »

I'd run: mythshutdown --check and see if it tells you what's
preventing shutdown. If that doesn't help, then I'd suggest
exiting everything (mythwelcome/mythfrontend...) except
the mythbackend. Type: mythbackend --setverbose idle,system
and watch the backend log. See if that gives you an indication
of why shutdown isn't working.

Maybe wakeup isn't working because the time isn't getting
set. That should be seen in the above logs too.
bhlevca
Newcomer
Posts: 6
Joined: Thu Sep 17, 2015 4:18 pm
Canada

Re: Mythwelcome refuses shutdown

Post by bhlevca »

Thanks Bill. I am going to try to test with your suggestions this weekend and write back.

I think that I ran the mythshutdown --check and it was fine, but for some reason when mythwelcome it gets to 0 starts again. Also sometimes it does not go all the way to 0.

I remember that I read somewhere that the wake information is written only if mythwelcome does the shutdown and it makes sense. If it does not shutdown, why bother waking up? But it prevented me to test that part. I know that waking up works because I've tested it manually. I just need to succeed of shutting it down with mythwelcome and I think that will solve both issues.
bhlevca
Newcomer
Posts: 6
Joined: Thu Sep 17, 2015 4:18 pm
Canada

Re: Mythwelcome refuses shutdown

Post by bhlevca »

mythshutdown --check returns always OK to shutdown. The verbose logging does not tell me anything extra
mythshutdown --shutdown does its job properly.

My permissons are set properly (sudo without password) and the mythsetup is configured as per the instructions on the ACPI website of mythtv.
I am running out of options. If you have other suggestions please do.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Mythwelcome refuses shutdown

Post by bill6502 »

You could try it this way: Shutdown everything myth, then start the backend like this:

Code: Select all

sudo mythbackend --user mythtv -v system,idle --loglevel debug --logpath /tmp
Wait for the shutdown to fail. If there's a pre shutdown check and if there's
a script setting the time, their command lines and exit codes will be in the
log. You can pastebin it and put a link to the pastebin here if you choose.

* and the command that shuts down the system will appear too, if the
backend is trying to run it.

I've been using shutdown when idle for years. I'm on 0.28-pre now, but it
worked fine in 0.27 too. I'm ignoring mythwelcome because I don't use it
and am trying to remove it from the puzzle for now.
bhlevca
Newcomer
Posts: 6
Joined: Thu Sep 17, 2015 4:18 pm
Canada

Re: Mythwelcome refuses shutdown

Post by bhlevca »

Thanks for the additional hints.

To make things clear, how do you want me to shutdown the system if I should not use mythwelcome?

I tried first the Desktop setup also mentioed o the same ACPI page, but that did not work either. What is not clear to me in the Desktop version is what and when is shutting down the system. I setup first mythsetup with that version, but noting happened, while with mythwelcome at least I could see that it is a countdown and something is happening. Althoug the same result.
bhlevca
Newcomer
Posts: 6
Joined: Thu Sep 17, 2015 4:18 pm
Canada

Re: Mythwelcome refuses shutdown

Post by bhlevca »

I tried your command and the backed lasts only for a few seconds. Because the log is not too long I attached it below. I highlighted the line that seem to have some sort of a problem. Maybe I need to change the configuration to used a different port?

Maybe I should try to upgrade to 0.28pre.

In general mythtv works fine on the system except that it refuses to shutdown.


debnas:~ # sudo mythbackend --user mythtv -v system,idle --loglevel debug --logpath /tmp
2015-09-26 09:54:14.747017 C mythbackend version: tag: v0.27.3 [9d871a9] http://www.mythtv.org
2015-09-26 09:54:14.747030 C Qt version: compile: 4.8.6, runtime: 4.8.6
2015-09-26 09:54:14.747032 N Enabled verbose msgs: general system idle
2015-09-26 09:54:14.747076 N Setting Log Level to LOG_DEBUG
2015-09-26 09:54:14.747308 I Added logging to the console
2015-09-26 09:54:14.747825 I Setup Interrupt handler
2015-09-26 09:54:14.747837 I Setup Terminated handler
2015-09-26 09:54:14.747844 I Setup Segmentation fault handler
2015-09-26 09:54:14.747852 I Setup Aborted handler
2015-09-26 09:54:14.747858 I Setup Bus error handler
2015-09-26 09:54:14.747864 I Setup Floating point exception handler
2015-09-26 09:54:14.747874 I Setup Illegal instruction handler
2015-09-26 09:54:14.747895 I Setup Real-time signal 0 handler
2015-09-26 09:54:14.747968 N Using runtime prefix = /usr
2015-09-26 09:54:14.747989 N Using configuration directory = /home/mythtv/.mythtv
2015-09-26 09:54:14.748055 I Assumed character encoding: en_US.UTF-8
2015-09-26 09:54:14.748331 N Empty LocalHostName.
2015-09-26 09:54:14.748336 I Using localhost value of debnas
2015-09-26 09:54:14.755674 D FindDatabase() - Success!
2015-09-26 09:54:14.757431 N Setting QT default locale to en_CA
2015-09-26 09:54:14.757508 I Current locale en_CA
2015-09-26 09:54:14.757550 N Reading locale defaults from /usr/share/mythtv//locales/en_ca.xml
2015-09-26 09:54:14.764052 I Current MythTV Schema Version (DBSchemaVer): 1317
2015-09-26 09:54:14.764391 I Loading en_ca translation for module mythfrontend
2015-09-26 09:54:14.765884 E MythSocket(269c320:-1): Failed to connect to (127.0.0.1:6543) Connection refused
2015-09-26 09:54:14.767264 D Adding IPv4 loopback to address list.
2015-09-26 09:54:14.767270 D Adding BackendServerIP6 to address list.
2015-09-26 09:54:14.767278 D Adding BackendServerIP to address list.
2015-09-26 09:54:14.767295 D Skipping address: [2607:f2c0:f00e:2700:69ce:c5a8:d2c3:e2b1]
2015-09-26 09:54:14.767308 D Skipping address: [2607:f2c0:f00e:2700:a60:6eff:fe67:ecd6]
2015-09-26 09:54:14.767326 D Adding link-local 'FE80::A60:6EFF:FE67:ECD6%enp3s0' to address list.
2015-09-26 09:54:14.767909 N MythBackend: Running as a slave backend.
2015-09-26 09:54:14.825675 D JobQueueRecover Run window between 104400 - 129600.
2015-09-26 09:54:14.825680 I Registering HouseKeeperTask 'JobQueueRecover'.
2015-09-26 09:54:14.825695 I Registering HouseKeeperTask 'HardwareProfiler'.
2015-09-26 09:54:14.825944 D JobQueueRecover Run window between 43200 - 99205.
2015-09-26 09:54:14.826321 I Starting HouseKeeper.
2015-09-26 09:54:14.827694 I Listening on TCP 127.0.0.1:6544
2015-09-26 09:54:14.827725 I Listening on TCP 10.0.0.9:6544
2015-09-26 09:54:14.827781 I Listening on TCP [::1]:6544
2015-09-26 09:54:14.827832 I Listening on TCP [fe80::a60:6eff:fe67:ecd6%enp3s0]:6544
2015-09-26 09:54:14.973343 I Added logging to mythlogserver at TCP:35327
2015-09-26 09:54:15.305476 I Main::Registering HttpStatus Extension
2015-09-26 09:54:15.307459 I Listening on TCP 127.0.0.1:6543
2015-09-26 09:54:15.307512 I Listening on TCP 10.0.0.9:6543
2015-09-26 09:54:15.307584 I Listening on TCP [::1]:6543
2015-09-26 09:54:15.307652 I Listening on TCP [fe80::a60:6eff:fe67:ecd6%enp3s0]:6543
2015-09-26 09:54:16.216967 I Bonjour: Service registration complete: name 'Mythbackend on debnas' type '_mythbackend._tcp.' domain: 'local.'
2015-09-26 09:54:16.307840 N Connecting to master server: 127.0.0.1:6543
2015-09-26 09:54:16.308182 N Connected successfully
2015-09-26 09:54:46.309864 E MythSocket(2516ae0:65): ReadStringList: Error, timed out after 30000 ms.
2015-09-26 09:54:46.309979 W MainServer: Unknown socket closing MythSocket(0x2516ae0)
2015-09-26 09:54:46.310068 E MythSocket(2516ae0:-1): No response.
2015-09-26 09:54:46.310078 E MainServer: Failed to open master server socket, timeout

2015-09-26 09:54:46.311032 I adding: debnas as a slave backend server
2015-09-26 09:54:46.311172 E MythSocket(2505b90:-1): WriteStringList: Error, called with unconnected socket.
2015-09-26 09:54:47.311001 N Connecting to master server: 127.0.0.1:6543
2015-09-26 09:54:47.311318 N Connected successfully
2015-09-26 09:55:17.312721 E MythSocket(2505b90:67): ReadStringList: Error, timed out after 30000 ms.
2015-09-26 09:55:17.312888 E MythSocket(2505b90:-1): No response.
2015-09-26 09:55:17.313063 E MainServer: Failed to open master server socket, timeout
Handling Segmentation fault
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: Mythwelcome refuses shutdown

Post by bill6502 »

Ouch. I'd suggest looking at your system to see how it starts the backend.
Mythbuntu uses /etc/init/mythtv-backend.conf, others use a script in /etc/init.d
and some use systemd. If you mention your distribution, maybe others can
help.

The command line I suggested is very typical. But I'd be concerned that your
backend is normally started as some user other than mythtv and that the above is
a result of using a different profile.

Do you truly have a master/slave configuration. If so, then 127.0.0.1 isn't a good
choice. Looks like the master backend should be 10.0.0.9. The line of
concern to me is:

Code: Select all

I adding: debnas as a slave backend server
I'm still trying to start just the backend (eliminating everything else for now)
just to get the shutdown/wakeup working. No need to switch to 0.28-pre.
bhlevca
Newcomer
Posts: 6
Joined: Thu Sep 17, 2015 4:18 pm
Canada

Re: Mythwelcome refuses shutdown

Post by bhlevca »

You got it right. I am using systemd on a Suse OS However, the mythtv configuration was ported along other configurations from a Debian therefore the debnas name.

The problem was that the user of the mythbackend was user mythbackend, while my permissions were given for the mythv user.
I did not realize this because I normally do

Code: Select all

ps ax
instead of

Code: Select all

ps -ef
which gives me the user name owner of the process

I also changed the Server IP to 10.0.0.9 and I get no connection errors anymore.

End result: It shuts down properly now,

Thanks for your patience to go through all this debugging.
Post Reply