ubuntu shutdown delays

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

Moderator: Forum Moderators

Post Reply
mtrax
Junior
Posts: 30
Joined: Sat Aug 16, 2014 6:44 am
Australia

ubuntu shutdown delays

Post by mtrax » Sun Jun 02, 2019 6:32 am

I'm seeing delays during shutdown .. mythbackend stop script doesn't seem to work..
any idea where to look for a solution to this?

mythtv-backend.service: State 'stop-sigterm' timed out. Killing.


un 2 16:20:14 mythbox systemd[1]: mythtv-backend.service: State 'stop-sigterm' timed out. Killing.
Jun 2 16:20:14 mythbox systemd[1]: mythtv-backend.service: Killing process 1701 (mythbackend) with signal SIGKILL.
Jun 2 16:20:14 mythbox systemd[1]: mythtv-backend.service: Main process exited, code=killed, status=9/KILL
Jun 2 16:20:14 mythbox systemd[1]: mythtv-backend.service: Failed with result 'timeout'.

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

Re: ubuntu shutdown delays

Post by bill6502 » Mon Jun 03, 2019 4:21 am

Hi,

I'd start with this: systemctl show --property TimeoutStopUSec mythtv-backend just to see
how much time is allowed. I expect 90 seconds.

Then decouple mythbackend from systemd. Stop the service: sudo systemctl stop mythtv-backend.service

Start it from the command line like: sudo mythbackend --user mythtv --logpath /tmp & (not usually a good
idea, but -v most,norefcount and --loglevel debug could be added.)

Note the PID when you spin it off and from another terminal window do: sudo kill SIGTERM backend_pid

Finally, a full copy of the log will be in /tmp and you can look at it with your favorite editor
or less etc. Lines after the signal is received by the backend may point to something that's
hanging around. Full disclosure, I don't have the problem. Happy hunting.

mtrax
Junior
Posts: 30
Joined: Sat Aug 16, 2014 6:44 am
Australia

Re: ubuntu shutdown delays

Post by mtrax » Mon Jun 03, 2019 8:12 am

timeout is 1min 30secs but I don't think its the problem

looking at the syslog I see stop was issued 16:18 and comparing that with mythbackend log I can see that stopped at that time.

I assume that fact wasn't detected by systemctl... how does it know when it stopped?

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

Re: ubuntu shutdown delays

Post by bill6502 » Mon Jun 03, 2019 4:00 pm

Right, I just wanted to know that the timeout hadn't been lowered.

systemd should just look at the return code from any program. 0 = OK. That
suggests that the backend isn't exiting fast enough.

Again, shutdown the service and run from the command line. That will prove
that it's not an systemd/mythbackend issue (and it likely isn't.) You also see
when the command line prompt returns, and you'll see how long it took.

The additional logging will add more information after the signal is received.
Looking/hoping that there's a clue in it.

Another tool is: ps -FLC mythbackend also run from that other terminal session.
My running, but inactive backend shows 25 threads.

Post Reply