Needs systemd unit or sysv init script, fix if-up.d script

Bug #1408651 reported by Martin Pitt
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
mythtv (Ubuntu)
Fix Released
Undecided
Martin Pitt

Bug Description

mythtv-backend only ships an upstart job. With https://blueprints.launchpad.net/ubuntu/+spec/core-1411-systemd-migration it needs an init.d script or a systemd script to also work under systemd.

On top of that, /etc/network/if-up.d/mythtv-backend.if-up.d does

  stop mythtv-backend || true
  start mythtv-backend || true

which is upstart specific. It must use "invoke-rc.d mythrv-backend restart" instead, which works for all init systems.

Martin Pitt (pitti)
tags: added: ifupdown systemd-boot
summary: - Needs systemd unit or sysv init script
+ Needs systemd unit or sysv init script, fix if-up.d script
Martin Pitt (pitti)
Changed in mythtv (Ubuntu):
status: New → In Progress
assignee: nobody → Martin Pitt (pitti)
Martin Pitt (pitti)
Changed in mythtv (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Mario Limonciello (superm1) wrote :

pitti:

Thanks for adding this. Some quick questions regarding usage with systemd.
1) Will the Wants & After stanzas for mysql cause it to only start after mysql is fully spawned and functional? We made it work specifically to check for a valid mysql connection rather than just wait for the upstart job in the past because of race conditional
problems.

2) We were previously sourcing /etc/default/locale and explicitly setting the LANG. Can this still be accomplished with systemd?

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package mythtv - 2:0.27.1+fixes.20140624.aa822f5-0ubuntu3

---------------
mythtv (2:0.27.1+fixes.20140624.aa822f5-0ubuntu3) vivid; urgency=medium

  * Add debian/mythtv-backend.service: systemd unit corresponding to upstart
    job.
  * debian/mythtv-backend.if-up.d: Use invoke-rc.d instead of stop/start to
    work under any init system. (LP: #1408651)
 -- Martin Pitt <email address hidden> Thu, 08 Jan 2015 15:55:45 +0100

Changed in mythtv (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Martin Pitt (pitti) wrote :

Hey Mario!

1) I did not copy that bit indeed; *if* mysql startup is racy, then any dependency of mysql would be affected by that, and we don't want to copy that snippet (or have the bug) in all of its dependencies. So if this is still an issue, this should be fixed in mysql's init.d script IMHO. At some point mysql should start supporting socket activation and get a systemd unit, then all the explicit ordering/dependencies/waiting loops won't be necessary any more.

2) /etc/default/locale is automatically exported to all systemd units, so this isn't necessary. Other environment files can be read with EnvironmentFile= (see man systemd.exec), but that's not necessary here. Note that just exporting $LANG is insufficient: Users can have different locales for different LC_* categories, i. e. they might choose to have numbers, monetary, date etc. format for their home country, but still chose to have English messages. So in principle this should be fixed in the upstart job too, but as we plan to switch to systemd this or next cycle at the latest, it's probably not worth it any more.

Revision history for this message
Martin Pitt (pitti) wrote :

Oh, forgot: If you experiment with that locally, you can add something like

  ExecStartPre=/bin/sh -c "[shell code]"

to the unit. As I said, if this is actually necessary this logic should rather go to /etc/init.d/mysql.

Revision history for this message
Jack Deslippe (jdeslip) wrote :

I just updated to 15.04 from 14.10 and in order to get the backend started at boot I had to manually add a /etc/systemd/system/mythbackend.service file based on the mythtv doc

I'm confused, based on this bug report,shouldn't this have been fixed??

Revision history for this message
Jack Deslippe (jdeslip) wrote :

By the way, I'm now on the ppa version 2:0.27.4+fixes.20150305.f1115fc-0ubuntu0mythbuntu1

Definitely no mythtv-backend.service file on my system.

Revision history for this message
Martin Pitt (pitti) wrote :

The PPA might not yet have the fix above?

Revision history for this message
Thomas Mashos (tgm4883) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.