[mythtv-users] FrontEnd will connect if feels like it
R. G. Newbury
newbury at mandamus.org
Tue Jul 12 17:43:17 UTC 2016
On 07/08/2016 12:28 PM, Barry Martin wrote:
>
> Hi Geoff!
>
>> I missed the start of this thread, so some of this may be redundant.
> Welcome to the fun! <g>
>
>
>> Does systemctl status mythbackend.service report that the backend is
>> running?
>
> Hmm: no, and before I go on some times this Frontend works/connects and
> some times it doesn't. The other Frontends don't seem to have a problem.
>
> The response to the command was:
> Loaded : not-found (Reason: No such file or directory)
> Active: inactive (dead)
OK, all the way back to basics.
1) You need network services running on the master box. Looks like you
have that: I am presuming you are posting from that box, otherwise all
bets are off!
2) You need mysql running on a computer with the mythconverg database.
It may be mysqld, mysqld.service or mariadb.service depending on
Ubuntu/Fedora/obselete-any-of-the-above.
Check on the "master" computer.
You must be able to do a 'mysql -umythtv -pmythtv mythconverg' on that
machine. (The "usual" setup parameters).
And 'systemctl status mysqld.service' (or systemctl status
mariadb.service) should return something like:
[root at tor1 pleadings]# systemctl status mariadb.service -l
● mariadb.service - MariaDB 10.0 database server
Loaded: loaded (/etc/systemd/system/mariadb.service; enabled)
Drop-In: /usr/lib/systemd/system/mariadb.service.d
└─mysql-compat.conf
Active: active (running) since Sun 2016-07-03 10:28:22 EDT; 1 weeks
2 days ago
Main PID: 982 (mysqld_safe)
CGroup: /system.slice/mariadb.service
├─ 982 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
└─1127 /usr/libexec/mysqld --basedir=/usr
--datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin
--log-error=/var/log/mariadb/mariadb.log
--pid-file=/var/run/mariadb/mariadb.pid --socket=/var/lib/mysql/mysql.sock
Jul 03 10:28:21 tor1.mandamus.org mysql-check-socket[898]: Socket file
/var/lib/mysql/mysql.sock exists.
Jul 03 10:28:21 tor1.mandamus.org mysql-check-socket[898]: No process is
using /var/lib/mysql/mysql.sock, which means it is a garbage, so it will
be removed automatically.
Jul 03 10:28:21 tor1.mandamus.org mysqld_safe[982]: 160703 10:28:21
mysqld_safe Logging to '/var/log/mariadb/mariadb.log'.
Jul 03 10:28:21 tor1.mandamus.org mysqld_safe[982]: 160703 10:28:21
mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
Jul 03 10:28:22 tor1.mandamus.org systemd[1]: Started MariaDB 10.0
database server.
If necessary try each of the ExecStartPre and ExecStart lines in
/lib/systemd/system/mariadb.service file and fix the errors
individually. You will often see permissions errors or missing folders
on a just-installed box.
This is a bit 'belt and suspenders' but I have the following in my
/etc/rc.d/rc.local file,
The /etc/rc.d/rc.local file is 'chmod 777' and I have run 'systemctl
enable rc-local.service' to make systemd run the file.
*************
/usr/bin/chmod 777 /var/log > /dev/null 2>&1
/usr/bin/mkdir /var/log/mariadb > /dev/null 2>&1
/usr/bin/chmod -v 0777 /var/log/mariadb > /dev/null 2>&1
/usr/bin/chown -v mysql:mysql /var/log/mariadb > /dev/null 2>&1
/usr/bin/touch /var/log/mariadb/mariadb.log > /dev/null 2>&1
/usr/bin/chown -v mysql:mysql /var/log/mariadb/mariadb.log > /dev/null 2>&1
/usr/bin/chmod 777 /var/log/mariadb/mariadb.log > /dev/null 2>&1
systemctl restart mariadb.service
*************
These will fix all sorts of niggly and obscure problems.
3) If you have a master box, on which the mythbackend service will be
run, you MUST have mysql set up to allow access from your OTHER boxes.
So the minimal "allow user at localhost" will not do.
As root mysql user get into mysql and use the mysql database;
mysql -u root -pyourpasswordhere mysql;
You need to see your mythtv user against each frontend box:
ariaDB [mysql]> select host,user,password from user;
+----------------------+--------+-------------------------+
| host | user | password |
+----------------------+--------+------------------------ +
| localhost | mythtv | *CC8F35F587CA5A556B4132 |
| myth.mandamus.org | mythtv | *CC8F35F587CA5A556B4132 |
| 192.168.1.99 | mythtv | *CC8F35F587CA5A556B4132 |
| 96-myth.mandamus.org | mythtv | *CC8F35F587CA5A556B4132 |
| 192.168.1.86 | mythtv | *CC8F35F587CA5A556B4132 |
| 192.168.1.95 | mythtv | *CC8F35F587CA5A556B4132 |
| tor2.mandamus.org | mythtv | *CC8F35F587CA5A556B4132 |
+----------------------+--------+-------------------------+
(The password hashes have been shortened).
The listing represents 4 separate computers, with my laptop showing up
as 2 different IP's depending upon its wired/wireless operation.
To do this requires grant access statements in mysql. Further
elucidation is left to the student as an exercise!
4) Now you can get mythbackend working on the master box.
This may be systemctl start mythbackend.service or some variant
depending on the distro.
BUT you start by running mythtv-setup from a console. Fill in the boxes,
to point to the correct place (your master box). Note that for frontend
only boxes, the mysql call is to the IP of the master box. And you will
not need a backend on those boxes.
Once through mythtv-setup, try running mythbackend ( or
mythbackend.real) from a console. If it runs through to 'started by
USER', you are good, except for debugging the mythbackend.service file,
(which should work from the install. unless you missed something or
changed something).
Then 'systemctl enable mythbackend.service' and reboot.
When everything is back up, try:
ps -ae | grep mythbackend from a console. Should be good.
5) Now you can start a frontend instance on the master box.
6) If that works, run mythtv-setup on your extra fronted boxes, and try
starting mythfrontend on them. The log will tell you where things went
wrong, if at all.
> When I do 'mythfrontend' at Terminal the log shoes "Found 1 UPnP
> backends" and the next line is about the SOAPClient not finding the IPv6
> address. When it connects it seems to be via the IPv4 address. I'm a
> newbie and think that seems to be significant. <g>
>
> OK, 'stupid tangent time'. Ping the IPv6 address (copied and pasted
> from log) ==> unknown host. Ping the IPv4 address, 0.218 ms, etc.
The IPv6 error means you have no mapping for it in /etc/hosts/
I have this at the top of mine:
127.0.0.1 localhost.localdomain localhost
::1 localhost.localdomain localhost6 localhost
HTH
--
R. Geoffrey Newbury
More information about the mythtv-users
mailing list