#1 25/04/2018 09:43:55

totola
Membre
Inscription : 20/04/2009
Messages : 410
Mythbox

mythbackend ne démarre qu'en console

Bonjour,

je ne comprends pas pour quoi le service mythtv-backend ne se lance pas automatiquement.

Tout marche correctement uniquement si je lance la commande  mythbackend en console...

si je lance le service mythtv-backend:

Job for mythtv-backend.service failed because the control process exited with error code. See "systemctl status mythtv-backend.service" and "journalctl -xe" for details.
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.

et journalctl -xe:

vril 25 09:42:18 lavarenne-System-Product-Name systemd[1]: mythtv-backend.service: Start request repeated too quickly.
avril 25 09:42:18 lavarenne-System-Product-Name systemd[1]: Failed to start MythTV Backend.
-- Subject: L'unité (unit) mythtv-backend.service a échoué
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- 
-- L'unité (unit) mythtv-backend.service a échoué, avec le résultat failed.
avril 25 09:42:20 lavarenne-System-Product-Name sudo[3948]: pam_unix(sudo:session):

(J'utilise mythtv 0.29 avec ubuntu 16.04)

MErci

Dernière modification par totola (25/04/2018 09:51:02)

Hors ligne

#2 25/04/2018 18:08:50

totola
Membre
Inscription : 20/04/2009
Messages : 410
Mythbox

Re : mythbackend ne démarre qu'en console

Bon, j'ai résolu en mettant mon nom d'utilisateur à la place de mythtv dans le fichier /lib/systemd/system/mythtv-backend.service

[Unit]
Description=MythTV Backend
Documentation=https://www.mythtv.org/wiki/Mythbackend
After=mysql.service network.target
 
[Service]
User=mythtv
EnvironmentFile=-/etc/mythtv/additional.args
ExecStart=/usr/bin/mythbackend --quiet --syslog local7 $ADDITIONAL_ARGS
StartLimitBurst=10
StartLimitInterval=10m
Restart=on-failure
RestartSec=1
 
[Install]
WantedBy=multi-user.target

Vous pensez que ça pose un soucis?
Tout marche bien en tout cas...

Hors ligne

#3 02/05/2018 21:41:00

SnouF
Webmasteur, développeurDéveloppeur de scripts pour mythtv (tel que des grabbeurs pour MythNetVision). S'occupe également du dépôt deb des scripts mythtv-fr et propose un dépôt mythtv-fixes pour debian (stable, testing et unstable).
Inscription : 02/11/2007
Messages : 4 565
Site Web Mythbox

Re : mythbackend ne démarre qu'en console

Coté sécurité je pense que ce n'est pas l'idéal mais bon ... les risques sont très limités je pense.

Je pense qu'il s'agit de problème de droits. Est-ce que l'utilisateur mythtv exist et est-il dans les bons groupes ?

groups mythtv
groups $USER #pour comparer

Hors ligne

#4 22/08/2018 22:41:30

lhebui
Membre
Lieu : Saint Martin des Bois
Inscription : 18/03/2008
Messages : 665
Mythbox

Re : mythbackend ne démarre qu'en console

Bonsoir,
Je galère pour que le service mythbackend fonctionne sur une raspbian stretch.

J'ai repiqué sur le site de mythtv le fichier en-dessous que j'ai mis dans /lib/systemd/system/mythbackend.service et 'ai créé un lien symbolique dans /etc/systemd/system/

# Do not edit this file, it will be replaced on update
# If you need to make modifications to this unit file first make a copy in # /etc/systemd/system

# This file is part of the packaging of MythTV #
# MythTV is free software; view http://www.mythtv.org for more information.
#
# It is sometimes necessary to wait for a capture device to finish (hot)plug
# initialization before the backend starts.  If this is necessary, 
# create a Wants and After entry for all the capture devices that
# one wishes to wait to be created before the backend starts using the systemd
# device name mangling names (/dev/some/thing turns 
# into dev-some-thing.device).  These normally should  be udev persistent 
# filename rules to avoid confusion.
# See the MythTV wiki for udev persistent filename # discussions found at:
# http://www.mythtv.org/wiki/Device_Filenames_and_udev
#
# In order to insure that systemd will create a device unit for the 
# capture device, one must insure that udev will have the tag "systemd"
# (i.e. add TAG+="systemd" to the udev rule).
#
# The MythTV package ships with a default udev rule file located in: 
# /lib/udev/rules.d/99-mythbackend.rules

[Unit]
Description=MythTV backend service
After=network.target mysqld.service NetworkManager-wait-online.service pingnetwork.service
Wants=pingnetwork.service

# Uncomment the following line if you will be using the mythweb plugin on the 
# same system as mythbackend.
#Wants=httpd.service

[Service]
# You have 2 choices for 'Type': simple or forking 
# These require ExecStart lines which are NOT interchangeable.
# Type=simple is recommended. 
# If using 'Type=simple'
# 1) you cannot have --daemon in the command line 

# If using 'Type=forking'
# 1) you must have --daemon in the command line AND
# 2) you must have  --pidfile /somewhere in the command line AND
# 3) you must have a line PIDFILE=/somewhere in the [service] stanza
# this lets systemd know how to find the forked process PID, 
# otherwise it presumes the starting process will be the remaining process
# (cf. with the mysqld_safe process which starts mysqld and then disappears).
# Specifying a pidfile with Type simple does not cause any problems and
# may help in debugging startup failures.

#Type=forking
Type=simple

Environment=MYTHCONFDIR=/etc/mythtv
# Default setting assumes a system wide install. Otherwise it should be set to 
# the folder containing the .mythtv subfolder containing the config.xml file 
# Such as
Environment=HOME=/usr/share/mythtv
# or
Environment=HOME=/~/.mythtv

# systemd changes execution from the calling user (possibly root) to this user
# if you have permissions problems or obscure errors try logging in as mythtv 
# See notes below
User=mythtv

# Uncomment one of the following...
# Use sysloging rather than separate logging:
#ExecStart=/usr/bin/mythbackend --syslog local7 

# If Type=forking you must specify the --daemon and --pidfile options:
#ExecStart=/usr/bin/mythbackend --daemon --logpath /var/log/mythtv --loglevel crit --pidfile /run/mythtv/mythbackend.pid 
#PIDFILE=/run/mythtv/mythbackend.pid

# Systemd sends stdout to syslog, and mythbackend has console logging enabled without --daemon.
# Send stdout to /dev/null so console logging doesn't go to syslog
StandardOutput=null
# Default setting for Type=simple.
ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv --loglevel crit

# Whether systemd will continue over-watch and restart on any halt
#Restart=Restart-always

[Install]
WantedBy=multi-user.target

Bon, je n'ai pas compris grand chose ...

Quand je lance la commande systemctl status :

sudo systemctl status mythbackend.service
● mythbackend.service - MythTV backend service
   Loaded: loaded (/lib/systemd/system/mythbackend.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-08-22 22:32:03 CEST; 4s ago
  Process: 4055 ExecStart=/usr/bin/mythbackend --logpath /var/log/mythtv --loglevel crit (code=exited, status=135)
 Main PID: 4055 (code=exited, status=135)

août 22 22:31:53 raspberrypi systemd[1]: Started MythTV backend service.
août 22 22:32:03 raspberrypi systemd[1]: mythbackend.service: Main process exited, code=exited, status=135/n/a
août 22 22:32:03 raspberrypi systemd[1]: mythbackend.service: Unit entered failed state.
août 22 22:32:03 raspberrypi systemd[1]: mythbackend.service: Failed with result 'exit-code'.

Donc j'ai un pb dans mon fichier.

Est-ce que quelqu'un pourrait me fournir un fichier qui fonctionne pour que je le teste ?

Je vous en remercie.


RPI3+ en mythtv et TVHEADEND (en construction pour les 2 ...)

Hors ligne

#5 23/08/2018 11:16:27

lhebui
Membre
Lieu : Saint Martin des Bois
Inscription : 18/03/2008
Messages : 665
Mythbox

Re : mythbackend ne démarre qu'en console

Suite au post de totola, j'avais changé le nom d'utilisateur mais j'avais oublié de relancer le démon systemd ... Donc pas pris en charge. C'était hier soir et tard ... et la nuit a porté conseil.

Après

systemctl daemon-reload

, mythbackend est correctement lancé :

sudo systemctl status mythbackend.service
● mythbackend.service - MythTV backend service
   Loaded: loaded (/lib/systemd/system/mythbackend.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2018-08-23 09:17:24 CEST; 1min 30s ago
 Main PID: 876 (mythbackend)
   CGroup: /system.slice/mythbackend.service
           └─876 /usr/bin/mythbackend --logpath /var/log/mythtv --loglevel crit

août 23 09:17:24 raspberrypi systemd[1]: Started MythTV backend service.

cool ...


RPI3+ en mythtv et TVHEADEND (en construction pour les 2 ...)

Hors ligne

Réponse rapide

Veuillez composer votre message et l'envoyer
Si vous êtes un être humain ne changez pas le contenu de ces deux champs.

Pied de page des forums

Propulsé par FluxBB

Webmasteur SnouF

Hébergé par Tuxfamily

Valid XHTML 1.0 Strict