MythTV / mythtv

The official MythTV repository
https://www.mythtv.org
GNU General Public License v2.0
704 stars 345 forks source link

web app using 'mythtv' as mythconverg password incorrectly #875

Closed jfabernathy closed 7 months ago

jfabernathy commented 7 months ago

However, If you create the mythtv user first and assign a GID, UID, --shell, and --home, before installing mythtv from DMO, on first use of the web app the database connection shows as failed and the password for mythconverg is 'mythtv'.

The password in /etc/mythtv/config.xml shows as a random password and if you copy it to the web app field for mythconverg password and then save and restart, everything shows connected and you can proceed. I haven't tested this on Ubuntu in a while but I have never had this problem and I've know I've sometimes created the mythtv user ahead of time. I don't recall any issues.

How often does it reproduce? Is there a required condition?

What is the expected behaviour?

What do you see instead?

Additional information

rcrdnalor commented 7 months ago

Additional Information: Per default, Debian installs and runs the mythtv-backend systemd service with

[Service]
User=mythtv
Environment=HOME=/var/lib/mythtv

Maybe, it is enough to check for $HOME ?

jfabernathy commented 7 months ago

I fixed this by changing the Environment= to:

Environment=HOME=/home/mythtv

Since I used sudo systemctl edit --full mythtv-backend.service to perform the edit, I hope this will not get overwritten by system updates.

It would be nice if deb-multimedia's version of mythtv package could test for an existing user 'mythtv' and change it's mythtv-backend.service file. Not sure where to bring this up.

ijc commented 7 months ago

Not sure where to bring this up.

I recommend dmo-discussion: https://www.deb-multimedia.org/mailinglist

jfabernathy commented 7 months ago

I'll take the discussion there.

http://www.deb-multimedia.org/lurker/message/20240301.140328.78427221.en.html

billmeek commented 7 months ago

If you type: systemctl --run cat mythtv-backend.service, you'll see (on the 1st line) where the active service lives. Should be under /etc/...

If you have any drop-ins, they will be displayed later in the output.

systemctl --global cat mythtv-backend.service should show the service file that the distribution created. The one you created will be used in place of that and shouldn't be touched by the distro.

-- Bill

jfabernathy commented 7 months ago

Thanks, Bill. That is helpful. Not sure what the output of the --global version means in my case. Output below:

im@den-pc:~$ systemctl --run cat mythtv-backend.service
# /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
Environment=HOME=/var/lib/mythtv
EnvironmentFile=-/etc/default/mythtv-backend
ExecStart=/usr/bin/mythbackend $EXTRA_ARGS
StartLimitBurst=10
StartLimitInterval=10m
Restart=on-failure
RestartSec=1

[Install]
WantedBy=multi-user.target

# /etc/systemd/system/mythtv-backend.service.d/override.conf
[Service]
ExecStartPre=-/usr/local/bin/hdhomerun_check.py 169.254.235.152

jim@den-pc:~$ systemctl --global cat mythtv-backend.service
No files found for mythtv-backend.service.
jim@den-pc:~$ 
billmeek commented 7 months ago

--global didn't work the way I thought. Try a simple:

ls -l /lib/systemd/system/mythtv-backend.service

To see if the distro put the service there.

jfabernathy commented 7 months ago

the deb-multimedia.org maintainer for mythtv will remove the Environment=HOME=/var/lib/mythtv statement in the next upload. That fixes the issue.