Opened 14 months ago

Last modified 7 months ago

#13160 new Patch - Bug Fix

mythbackend process not stopped when using mythtv-setup

Reported by: mike.bibbings@… Owned by:
Priority: minor Milestone: 29.2
Component: Packaging Version: v29.0
Severity: medium Keywords:
Cc: Ticket locked: no

Description

When using mythtv-setup the backend if running should be stopped.The test for this in /usr/share/mythtv/mythtv-setup.sh fails on Ubuntu/Debian? using systemd due to the status command RUNNING=$(status mythtv-backend | grep running)

Changing the test to use ps allows this to work. RUNNING=$(ps -A | grep mythbackend)

A pull request 71 has been generated for the mythtv/packaging repository, this should be applied to master, fixes/0.28, fixes/29

Change History (7)

comment:1 Changed 14 months ago by Stuart Auchterlonie

Milestone: needs_triage29.1
Version: Unspecifiedv29.0

comment:2 Changed 11 months ago by vincent.mcintyre@…

Wouldn't this be more robust

-        RUNNING=$(status mythtv-backend | grep running)
-        if [ -n "$RUNNING" ]; then
+        if pgrep -x mythbackend >/dev/null; then

comment:3 Changed 11 months ago by mike.bibbings@…

I have no preference in how this issue is fixed. My only concern is generating error messages unnecessarily e.g. status: Name "com.ubuntu.Upstart" does not exist, it can cause user confusion. Feel free to change as you see fit.

Mike

comment:4 Changed 11 months ago by Stuart Auchterlonie

Milestone: 29.10.28.2

Moving remaining open tickets to 0.28.2 milestone

comment:5 Changed 11 months ago by Stuart Auchterlonie

Milestone: 0.28.229.2

Moving remaining open tickets to 29.2 milestone

comment:6 Changed 8 months ago by georgep56

I've just come across this issue again with my install of 29.1-fixes on Lubuntu 16.10.

I had previously edited mythtv-setup with the suggested

RUNNING=$(ps -A | grep mythbackend)

which worked perfectly for me.

The latest 29.1-fixes update has replaced this with another suggested "fix" mentioned above

RUNNING=$(status mythtv-backend | grep running)

This raised 2 further issues: The binary "status" was not present on my system. I found that it was part of the "upstart" package which was not installed. I installed the upstart package but this then revealed a further issue -

george@tvbox:$ status mythtv-backend status: Name "com.ubuntu.Upstart" does not exist

For now I have implemented the 'pgrep' solution above (which is now targeted on 29.2 I believe) and would like to request that this be implemented on 29.1-fixes as soon as is convenient.

comment:7 Changed 7 months ago by baizej

Too keep code similar to the other start/stop commands, why wouldn't the service wrapper be used for status as well?

RUNNING=$(/usr/sbin/service mythtv-backend status | grep running)

The $RUNNING variable is used later in the same script so removing it as indicated in the first solution would invalidate the other if statements using $RUNNING.

Note: See TracTickets for help on using tickets.