[mythtv-users] mythtv XMLTV wiki instructions

Bill Meek keemllib at gmail.com
Thu Jul 30 00:47:52 UTC 2020


On 7/29/20 7:13 PM, Mark Perkins wrote:
> 
> ________________________________
> From: "A. F. Cano" <afc54 at comcast.net>
> Sent: Thursday, 30 July 2020 9:25 am
> To: mythtv-users at mythtv.org
> Subject: Re: [mythtv-users] mythtv XMLTV wiki instructions
> 
> On Wed, Jul 29, 2020 at 04:48:05PM -0400, James Abernathy wrote:
>>     On Wed, Jul 29, 2020 at 2:20 PM Mark Perkins <[1]perkins1724 at hotmail.com>
>>     wrote:
>>
>>     ══════════════════════════════════════════════════════════════════════════
>>
>>       From: James Abernathy <[2]jfabernathy at gmail.com>
>>       Sent: Thursday, 30 July 2020 2:02 am
>>       To: Discussion about MythTV
>>       Subject: [mythtv-users] mythtv XMLTV wiki instructions
>>
>>         I noticed the addition of:
>>         Be sure to read: [3]#MythTV_Setup. Hint: sudo --login --user=mythtv
>>         in the mythtv xmltv wiki.  I normally just sudo su mythtv and then do
>>         all the commands to set up the XMLTV.  However today I thought I just
>>         see how prefacing the normal instructions with the sudo --login --user
>>         mythtv and got an error message on on the second command in the
>>         setting up with tv_grab_zz_sdjson_sqlite:
>>         jim at mythbuntu:~$ sudo --login --user=mythtv tv_grab_zz_sdjson_sqlite
>>         --configure --config-file $HOME/.mythtv/SD.xmltv
>>         Failed to write to /home/jim/.mythtv/SD.xmltv.TMP at
>>         /usr/local/share/perl/5.30.0/XMLTV/Configure.pm<http://Configure.pm> line 187.
>>         Not sure why and just thought I'd report it.
>>         I'll stick to my tried and true method of just sudo su mythtv and then
>>         do all the work. And when I did it this time I just initialized and it
>>         all worked.
>>         Jim A
>>
>>
>>
>>       What does this return?
>>       sudo --login --user=mythtv echo $HOME
>>       And how does it compare to:
>>       sudo su mythtv
>>       echo $HOME
>>
>>     Yeap, it different:
>>     jim at mythbuntu:~$ sudo --login --user=mythtv echo $HOME
>>     [sudo] password for jim:
>>     /home/jim
>>     jim at mythbuntu:~$ sudo su mythtv
>>     mythtv at mythbuntu:/home/jim$ echo $HOME
>>     /home/mythtv
>>     mythtv at mythbuntu:/home/jim$
>>     Jim A
> 
> Interestingly, on Debian 10/stable (up to date) I get the same $HOME:
> 
> <custom-prompt> sudo --login --user=mythtv
> $ echo $HOME
> /var/lib/mythtv
> $ ^D
> <custom-prompt> sudo su mythtv
> <custom-prompt> echo $HOME
> /var/lib/mythtv
> <custom-prompt> ^D
> <custom-prompt>
> 
> The only difference is that with the --login option it executes a login
> shell, which does reset the PS1 variable, which is otherwise not changed
> in the second case.  I set PS1 to a <custom-prompt> in ~/.bash_aliases,
> called from ~/.bashrc.
> 
> This is probably how it's supposed to work.
> 
> Augustine
> _______________________________________________
> mythtv-users mailing list
> 
> 
> Decided to check the wiki - yes it appears the command should be two lines not one.
> 
> Or more specifically - the intention (hint) is not to preface the normal instructions with the sudo --login --user mythtv. The intention is to use sudo --login --user mythtv without a command at the end to open an interactive shell and enter the commands inside that shell.

Since I wrote the hint, and it "works for me", the intention was to prefix all of the
commands with it. What I actually use is a BEcomeMythtv alias:

   alias bem='sudo --set-home --login --user=mythtv'

So: bem tv_grab..... does the desired job. Prefixing all four of the
grabber setup commands with bem or the full sudo line above.

But it's wrong for yet another reason. Some users have a system mythtv user in
/etc/password with no HOME or SHELL. Using MYTHCONFDIR locates the things
'normally' found in ~mythtv.

A cop-out may be specifying the full path or warning that MYTHCONFDIR may
be in play (which can be discovered with):

   $ systemctl show --property=User,Home,Environment mythtv-backend
   Environment=MYTHCONFDIR=/home/mythtv/.mythtv
   User=mythtv

But, that's only valid for systemd. Better cop-out: run as the mythtv
user and location of it's configuration directory. Which ruins the
whole hint concept.

-- 
Bill


More information about the mythtv-users mailing list