[mythtv-users] Mythbackend not starting automatically
Mike Bibbings
mike.bibbings at gmail.com
Thu Sep 15 18:54:05 UTC 2016
On 15/09/16 19:05, Jack McGee wrote:
> This is Mythtv .28 on Ubuntu 16.04. separate backend and frontend.
> Many fits and starts after upgrade to 16.04 but finally got it running.
> It still does not want to start automatically:
>
> I can start mythbackend after startup with systemctl start
> mythtv-backend but it will not start automatically. It appear it is
> starting before mysql?
>
>
> mythuser at amethi:/etc/mysql/conf.d$ sudo systemctl status mysql.service
> [sudo] password for mythuser:
> ● mysql.service - MySQL Community Server
> Loaded: loaded (/lib/systemd/system/mysql.service; enabled; vendor
> preset: enabled)
> Active: active (running) since Thu 2016-09-15 12:33:36 CDT; 15min ago
> Process: 3801 ExecStartPost=/usr/share/mysql/mysql-systemd-start
> post (code=exited, status=0/SUCCESS)
> Process: 3794 ExecStartPre=/usr/share/mysql/mysql-systemd-start pre
> (code=exited, status=0/SUCCESS)
> Main PID: 3800 (mysqld)
> CGroup: /system.slice/mysql.service
> └─3800 /usr/sbin/mysqld
>
> Sep 15 12:33:35 amethi systemd[1]: Stopped MySQL Community Server.
> Sep 15 12:33:35 amethi systemd[1]: Starting MySQL Community Server...
> Sep 15 12:33:36 amethi systemd[1]: Started MySQL Community Server.
> mythuser at amethi:/etc/mysql/conf.d$ systemctl status mythtv-backend
> ● mythtv-backend.service - MythTV Backend
> Loaded: loaded (/lib/systemd/system/mythtv-backend.service;
> enabled; vendor preset: enabled)
> Active: inactive (dead) (Result: exit-code) since Thu 2016-09-15
> 12:33:19 CDT; 17min ago
> Docs: https://www.mythtv.org/wiki/Mythbackend
> Process: 2934 ExecStart=/usr/bin/mythbackend --quiet --syslog local7
> $ADDITIONAL_ARGS (code=exited, status=130)
> Main PID: 2934 (code=exited, status=130)
>
> Sep 15 12:33:18 amethi systemd[1]: mythtv-backend.service: Unit
> entered failed state.
> Sep 15 12:33:18 amethi systemd[1]: mythtv-backend.service: Failed with
> result 'exit-code'.
> Sep 15 12:33:19 amethi systemd[1]: mythtv-backend.service: Service
> hold-off time over, scheduling restart.
> Sep 15 12:33:19 amethi systemd[1]: Stopped MythTV Backend.
> Sep 15 12:33:19 amethi systemd[1]: mythtv-backend.service: Start
> request repeated too quickly.
> Sep 15 12:33:19 amethi systemd[1]: Failed to start MythTV Backend.
> mythuser at amethi:/etc/mysql/conf.d$ systemctl start mythtv-backend
> ==== AUTHENTICATING FOR org.freedesktop.systemd1.manage-units ===
> Authentication is required to start 'mythtv-backend.service'.
> Authenticating as: mythuser,,, (mythuser)
> Password:
> ==== AUTHENTICATION COMPLETE ===
>
>
> and the mythbackend log:
>
>
> Sep 15 12:33:17 amethi mythbackend: mythbackend[2900]: E CoreContext
> mmulticastsocketdevice.cpp:60 (MMulticastSocketDevice)
> MMulticastSocketDevice(239.255.255.250:11): setsockopt -
> IP_ADD_MEMBERSHIP #012#011#011#011eno: No such device (19)
> Sep 15 12:33:17 amethi mythbackend: mythbackend[2900]: I LogForward
> loggingserver.cpp:295 (SyslogLogger) Added syslogging
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: C
> thread_unknown mythcommandlineparser.cpp:2599 (ConfigureLogging)
> mythbackend version: fixes/0.28 [v0.28-52-ge6a60f7] www.mythtv.org
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: C
> thread_unknown mythcommandlineparser.cpp:2601 (ConfigureLogging) Qt
> version: compile: 5.5.1, runtime: 5.5.1
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: N
> thread_unknown mythcommandlineparser.cpp:2603 (ConfigureLogging)
> Enabled verbose msgs: general
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: N
> thread_unknown logging.cpp:920 (logStart) Setting Log Level to LOG_INFO
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: I Logger
> logging.cpp:313 (run) Added logging to the console
>
> <snip>
>
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: N
> thread_unknown mythdirs.cpp:192 (InitializeMythDirs) Using runtime
> prefix = /usr
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: N
> thread_unknown mythdirs.cpp:194 (InitializeMythDirs) Using
> configuration directory = /home/mythtv/.mythtv
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: I CoreContext
> mythcorecontext.cpp:266 (Init) Assumed character encoding: en_US.UTF-8
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: N CoreContext
> mythcontext.cpp:505 (LoadDatabaseSettings) Empty LocalHostName.
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: I CoreContext
> mythcontext.cpp:513 (LoadDatabaseSettings) Using localhost value of
> amethi
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: E CoreContext
> mythdbcon.cpp:229 (OpenDatabase) [DBManager0] Unable to connect to
> database!
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: E CoreContext
> mythdbcon.cpp:230 (OpenDatabase) Driver error was [1/2002]:#012QMYSQL:
> Unable to connect#012Database error was:#012Can't connect to local
> MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: C CoreContext
> main.cpp:132 (main) Failed to init MythContext.
> Sep 15 12:33:18 amethi mythbackend: mythbackend[2934]: E CoreContext
> mmulticastsocketdevice.cpp:60 (MMulticastSocketDevice)
> MMulticastSocketDevice(239.255.255.250:11): setsockopt -
> IP_ADD_MEMBERSHIP #012#011#011#011eno: No such device (19)
>
>
> then:
>
> I guess after I started it manually:
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: C
> thread_unknown mythcommandlineparser.cpp:2599 (ConfigureLogging)
> mythbackend version: fixes/0.28 [v0.28-52-ge6a60f7] www.mythtv.org
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: C
> thread_unknown mythcommandlineparser.cpp:2601 (ConfigureLogging) Qt
> version: compile: 5.5.1, runtime: 5.5.1
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N
> thread_unknown mythcommandlineparser.cpp:2603 (ConfigureLogging)
> Enabled verbose msgs: general
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N
> thread_unknown logging.cpp:920 (logStart) Setting Log Level to LOG_INFO
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I Logger
> logging.cpp:313 (run) Added logging to the console
>
> <snip>
>
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N
> thread_unknown mythdirs.cpp:192 (InitializeMythDirs) Using runtime
> prefix = /usr
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N
> thread_unknown mythdirs.cpp:194 (InitializeMythDirs) Using
> configuration directory = /home/mythtv/.mythtv
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I CoreContext
> mythcorecontext.cpp:266 (Init) Assumed character encoding: en_US.UTF-8
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N CoreContext
> mythcontext.cpp:505 (LoadDatabaseSettings) Empty LocalHostName.
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I CoreContext
> mythcontext.cpp:513 (LoadDatabaseSettings) Using localhost value of
> amethi
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N CoreContext
> mythcorecontext.cpp:1670 (InitLocale) Setting QT default locale to EN_US
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I CoreContext
> mythcorecontext.cpp:1703 (SaveLocaleDefaults) Current locale EN_US
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N CoreContext
> mythlocale.cpp:123 (LoadDefaultsFromXML) Reading locale defaults from
> /usr/share/mythtv//locales/en_us.xml
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I CoreContext
> mythtranslation.cpp:73 (load) Loading en_us translation for module
> mythfrontend
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I CoreContext
> schemawizard.cpp:120 (Compare) Current MythTV Schema Version
> (DBSchemaVer): 1344
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I CoreContext
> mythtranslation.cpp:73 (load) Loading en_us translation for module
> mythfrontend
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: N CoreContext
> main_helpers.cpp:597 (run_backend) MythBackend: Starting up as the
> master server.
> Sep 15 12:50:42 amethi mythbackend: mythbackend[6345]: I LogForward
> loggingserver.cpp:295 (SyslogLogger) Added syslogging
> Sep 15 12:50:43 amethi mythbackend: mythbackend[6345]: I CoreContext
> recorders/v4lchannel.cpp:542 (SetInputAndFormat)
> V4LChannel[14](/dev/video0): SetInputAndFormat(14, NTSC) (v4l v2)
> input_switch: 0 mode_switch: 1
> Sep 15 12:50:43 amethi mythbackend: mythbackend[6345]: I SystemManager
> mythsystemunix.cpp:276 (run) Starting process manager
>
> _______________________________________________
> mythtv-users mailing list
> mythtv-users at mythtv.org
> http://lists.mythtv.org/mailman/listinfo/mythtv-users
> http://wiki.mythtv.org/Mailing_List_etiquette
> MythTV Forums: https://forum.mythtv.org
This has been recently discussed on a mythtv thread:
http://www.gossamer-threads.com/lists/mythtv/users/602276
Here is the solution I used (it is similar to that in the mythtv thread
but is slightly easier to setup, no creation of directory and file, it
uses systemd built-in functionality). This change should continue to
work when mythtv is updated.
In a terminal on the machine running mythtv backend:
sudo systemctl enable NetworkManager-wait-online.service
sudo systemctl edit mythtv-backend.service
Then paste the following 2 lines
[Unit]
After=NetworkManager-wait-online.service
Then exit from the edit screen (it uses nano by default, so Ctrl+x, then
y, then Return key)
Now reboot the system (sudo reboot)
Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20160915/aea57966/attachment.html>
More information about the mythtv-users
mailing list