Opened 6 years ago

Closed 2 years ago

#13160 closed Patch - Bug Fix (Trac EOL)

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 (8)

comment:1 Changed 6 years ago by Stuart Auchterlonie

Milestone: needs_triage29.1
Version: Unspecifiedv29.0

comment:2 Changed 6 years 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 6 years 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 6 years ago by Stuart Auchterlonie

Milestone: 29.10.28.2

Moving remaining open tickets to 0.28.2 milestone

comment:5 Changed 6 years ago by Stuart Auchterlonie

Milestone: 0.28.229.2

Moving remaining open tickets to 29.2 milestone

comment:6 Changed 6 years 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 6 years 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.

comment:8 Changed 2 years ago by Stuart Auchterlonie

Resolution: Trac EOL
Status: newclosed

We have moved all bug tracking to github [1]

If you continue to have this issue, please open a new issue at github, referencing this ticket.

[1] - https://github.com/MythTV/mythtv/issues

Note: See TracTickets for help on using tickets.