Mailing List Archive

mythtv XMLTV wiki instructions
I noticed the addition of:
Be sure to read: #MythTV_Setup
<https://www.mythtv.org/wiki/XMLTV#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@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 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
Re: mythtv XMLTV wiki instructions [ In reply to ]
________________________________
From: James Abernathy <jfabernathy@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: #MythTV_Setup<https://www.mythtv.org/wiki/XMLTV#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@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 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
Re: mythtv XMLTV wiki instructions [ In reply to ]
On Wed, Jul 29, 2020 at 2:20 PM Mark Perkins <perkins1724@hotmail.com>
wrote:

>
> ------------------------------
> *From:* James Abernathy <jfabernathy@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: #MythTV_Setup
> <https://www.mythtv.org/wiki/XMLTV#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@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 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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
[sudo] password for jim:
/home/jim
jim@mythbuntu:~$ sudo su mythtv
mythtv@mythbuntu:/home/jim$ echo $HOME
/home/mythtv
mythtv@mythbuntu:/home/jim$

Jim A
Re: mythtv XMLTV wiki instructions [ In reply to ]
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@hotmail.com>
> wrote:
>
> ??????????????????????????????????????????????????????????????????????????
>
> From: James Abernathy <[2]jfabernathy@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@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 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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
> [sudo] password for jim:
> /home/jim
> jim@mythbuntu:~$ sudo su mythtv
> mythtv@mythbuntu:/home/jim$ echo $HOME
> /home/mythtv
> mythtv@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
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: mythtv XMLTV wiki instructions [ In reply to ]
________________________________
From: James Abernathy <jfabernathy@gmail.com>
Sent: Thursday, 30 July 2020 6:18 am
To: Discussion about MythTV
Subject: Re: [mythtv-users] mythtv XMLTV wiki instructions



On Wed, Jul 29, 2020 at 2:20 PM Mark Perkins <perkins1724@hotmail.com<mailto:perkins1724@hotmail.com>> wrote:

________________________________
From: James Abernathy <jfabernathy@gmail.com<mailto:jfabernathy@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: #MythTV_Setup<https://www.mythtv.org/wiki/XMLTV#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@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 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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
[sudo] password for jim:
/home/jim
jim@mythbuntu:~$ sudo su mythtv
mythtv@mythbuntu:/home/jim$ echo $HOME
/home/mythtv
mythtv@mythbuntu:/home/jim$

Jim A

Sorry my bad that was maybe a bad test I think the $ needs to be escaped. Try:
sudo --login --user=mythtv echo \$HOME

Versus:
sudo su mythtv
echo $HOME

Which is probably also the issue with the initial command ie it should be:
sudo --login --user=mythtv tv_grab_zz_sdjson_sqlite --configure --config-file \$HOME/.mythtv/SD.xmltv
Re: mythtv XMLTV wiki instructions [ In reply to ]
On Wed, Jul 29, 2020 at 8:03 PM Mark Perkins <perkins1724@hotmail.com>
wrote:

>
> ------------------------------
> *From:* James Abernathy <jfabernathy@gmail.com>
> *Sent:* Thursday, 30 July 2020 6:18 am
> *To:* Discussion about MythTV
> *Subject:* Re: [mythtv-users] mythtv XMLTV wiki instructions
>
>
>
> On Wed, Jul 29, 2020 at 2:20 PM Mark Perkins <perkins1724@hotmail.com>
> wrote:
>
>>
>> ------------------------------
>> *From:* James Abernathy <jfabernathy@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: #MythTV_Setup
>> <https://www.mythtv.org/wiki/XMLTV#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@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 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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
> [sudo] password for jim:
> /home/jim
> jim@mythbuntu:~$ sudo su mythtv
> mythtv@mythbuntu:/home/jim$ echo $HOME
> /home/mythtv
> mythtv@mythbuntu:/home/jim$
>
> Jim A
>
>
> Sorry my bad that was maybe a bad test I think the $ needs to be escaped.
> Try:
> sudo --login --user=mythtv echo \$HOME
>
> Versus:
> sudo su mythtv
> echo $HOME
>
> Which is probably also the issue with the initial command ie it should be:
> sudo --login --user=mythtv tv_grab_zz_sdjson_sqlite --configure
> --config-file \$HOME/.mythtv/SD.xmltv
>

jim@mythbuntu:~$ sudo --login --user=mythtv echo \$HOME
/home/mythtv
jim@mythbuntu:~$ sudo su mythtv
mythtv@mythbuntu:/home/jim$ echo $HOME
/home/mythtv
mythtv@mythbuntu:/home/jim$

Jim A
Re: mythtv XMLTV wiki instructions [ In reply to ]
________________________________
From: "A. F. Cano" <afc54@comcast.net>
Sent: Thursday, 30 July 2020 9:25 am
To: mythtv-users@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@hotmail.com>
> wrote:
>
> ??????????????????????????????????????????????????????????????????????????
>
> From: James Abernathy <[2]jfabernathy@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@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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
> [sudo] password for jim:
> /home/jim
> jim@mythbuntu:~$ sudo su mythtv
> mythtv@mythbuntu:/home/jim$ echo $HOME
> /home/mythtv
> mythtv@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.
Re: mythtv XMLTV wiki instructions [ In reply to ]
On Wed, Jul 29, 2020 at 8:15 PM Mark Perkins <perkins1724@hotmail.com>
wrote:

>
> ------------------------------
> *From:* "A. F. Cano" <afc54@comcast.net>
> *Sent:* Thursday, 30 July 2020 9:25 am
> *To:* mythtv-users@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@hotmail.com>
> > wrote:
> >
> >
> ??????????????????????????????????????????????????????????????????????????
> >
> > From: James Abernathy <[2]jfabernathy@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@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 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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
> > [sudo] password for jim:
> > /home/jim
> > jim@mythbuntu:~$ sudo su mythtv
> > mythtv@mythbuntu:/home/jim$ echo $HOME
> > /home/mythtv
> > mythtv@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.
>

In my book that's the same as "sudo su mythtv". You have to exit from that
to get my to your normal user as well. I generally start by doing "cd" just
to make sure I'm at $HOME. But it works either way.

Jim A
Re: mythtv XMLTV wiki instructions [ In reply to ]
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.

In my book that's the same as "sudo su mythtv". You have to exit from that to get my to your normal user as well. I generally start by doing "cd" just to make sure I'm at $HOME. But it works either way.

Jim A


I don't believe that it is exactly the same but whether the difference is significant in this context i will leave to others. Testing using "pwd" and "echo $PATH" between the two methods showed differences on my system that may be significant.

At least the original problem (escaping the $) is now resolved.
Re: mythtv XMLTV wiki instructions [ In reply to ]
On 7/29/20 7:13 PM, Mark Perkins wrote:
>
> ________________________________
> From: "A. F. Cano" <afc54@comcast.net>
> Sent: Thursday, 30 July 2020 9:25 am
> To: mythtv-users@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@hotmail.com>
>> wrote:
>>
>> ??????????????????????????????????????????????????????????????????????????
>>
>> From: James Abernathy <[2]jfabernathy@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@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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
>> [sudo] password for jim:
>> /home/jim
>> jim@mythbuntu:~$ sudo su mythtv
>> mythtv@mythbuntu:/home/jim$ echo $HOME
>> /home/mythtv
>> mythtv@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
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: mythtv XMLTV wiki instructions [ In reply to ]
>
>
> 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.

Interesting. For me:
bem echo \$HOME

Is a different result to:
bem echo $HOME

Maybe differences in default security policy between distros? Maybe different default shell quoting?


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
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org
Re: mythtv XMLTV wiki instructions [ In reply to ]
On Wed, Jul 29, 2020 at 7:07 PM Mark Perkins <perkins1724@hotmail.com>
wrote:

>
> Interesting. For me:
> bem echo \$HOME
>
> Is a different result to:
> bem echo $HOME
>
>
That is because, in the latter case, $HOME is expanded in your current
shell, before the command line is executed. When the $ is escaped, as in
the first example, then the "$HOME" is expanded when the echo command is
actually executed, in a sudo subshell.

I would expect the second case to produce the same result as just doing
"echo $HOME".

--Greg
Re: mythtv XMLTV wiki instructions [ In reply to ]
________________________________
From: Greg Woods <greg@gregandeva.net>
Sent: Thursday, 30 July 2020 11:20 pm
To: Discussion about MythTV
Subject: Re: [mythtv-users] mythtv XMLTV wiki instructions



On Wed, Jul 29, 2020 at 7:07 PM Mark Perkins <perkins1724@hotmail.com<mailto:perkins1724@hotmail.com>> wrote:

Interesting. For me:
bem echo \$HOME

Is a different result to:
bem echo $HOME


That is because, in the latter case, $HOME is expanded in your current shell, before the command line is executed. When the $ is escaped, as in the first example, then the "$HOME" is expanded when the echo command is actually executed, in a sudo subshell.

I would expect the second case to produce the same result as just doing "echo $HOME".

--Greg

Exactly. I'm puzzled as to how others don't get the expansion in the originating shell in the latter case but as others have said wiki works for them.
Re: mythtv XMLTV wiki instructions [ In reply to ]
On Thu, Jul 30, 2020 at 6:06 PM Mark Perkins <perkins1724@hotmail.com>
wrote:

>
> ------------------------------
> *From:* Greg Woods <greg@gregandeva.net>
> *Sent:* Thursday, 30 July 2020 11:20 pm
> *To:* Discussion about MythTV
> *Subject:* Re: [mythtv-users] mythtv XMLTV wiki instructions
>
>
>
> On Wed, Jul 29, 2020 at 7:07 PM Mark Perkins <perkins1724@hotmail.com>
> wrote:
>
>>
>> Interesting. For me:
>> bem echo \$HOME
>>
>> Is a different result to:
>> bem echo $HOME
>>
>>
> That is because, in the latter case, $HOME is expanded in your current
> shell, before the command line is executed. When the $ is escaped, as in
> the first example, then the "$HOME" is expanded when the echo command is
> actually executed, in a sudo subshell.
>
> I would expect the second case to produce the same result as just doing
> "echo $HOME".
>
> --Greg
>
> Exactly. I'm puzzled as to how others don't get the expansion in the
> originating shell in the latter case but as others have said wiki works for
> them.
>
>
> I'm one of the ones who says I follow the wiki verbatim. However, I
haven't studied it in a while since I just go to the section on installing
XMLTV and then the section on the tv_grab_zz_sdjson_sqlite grabber setup.
Once I realized the key was to do those commands as user 'mythtv' I always
did my standard switching users as sudo su mythtv. BTW, I make sure user
mythtv has the bash shell as it's default so you can see the user and
current directory before the $ on every command. My first steps anytime
I've just switched users is to; 'whoami' and 'pwd' to make sure. I'm the
guy who did del *.* in CPU back in the '80 from root and learned to triple
check where I am and who I am before anything important. When you are as
old as I am you really have to do that :-)

Jim A
Re: mythtv XMLTV wiki instructions [ In reply to ]
On 7/29/20 7:08 PM, James Abernathy wrote:
>
>
> On Wed, Jul 29, 2020 at 8:03 PM Mark Perkins <perkins1724@hotmail.com <mailto:perkins1724@hotmail.com>> wrote:
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------
> *From:* James Abernathy <jfabernathy@gmail.com <mailto:jfabernathy@gmail.com>>
> *Sent:* Thursday, 30 July 2020 6:18 am
> *To:* Discussion about MythTV
> *Subject:* Re: [mythtv-users] mythtv XMLTV wiki instructions
>
>
>
> On Wed, Jul 29, 2020 at 2:20 PM Mark Perkins <perkins1724@hotmail.com <mailto:perkins1724@hotmail.com>> wrote:
>
>
> ------------------------------------------------------------------------------------------------------------------------------------------------
> *From:* James Abernathy <jfabernathy@gmail.com <mailto:jfabernathy@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: #MythTV_Setup <https://www.mythtv.org/wiki/XMLTV#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@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 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@mythbuntu:~$ sudo --login --user=mythtv echo $HOME
> [sudo] password for jim:
> /home/jim
> jim@mythbuntu:~$ sudo su mythtv
> mythtv@mythbuntu:/home/jim$ echo $HOME
> /home/mythtv
> mythtv@mythbuntu:/home/jim$
>
> Jim A
>
> Sorry my bad that was maybe a bad test I think the $ needs to be escaped. Try:
> sudo --login --user=mythtv echo \$HOME
>
> Versus:
> sudo su mythtv
> echo $HOME
>
> Which is probably also the issue with the initial command ie it should be:
> sudo --login --user=mythtv tv_grab_zz_sdjson_sqlite --configure --config-file \$HOME/.mythtv/SD.xmltv
>
>
> jim@mythbuntu:~$ sudo --login --user=mythtv echo \$HOME
> /home/mythtv
> jim@mythbuntu:~$ sudo su mythtv
> mythtv@mythbuntu:/home/jim$ echo $HOME
> /home/mythtv
> mythtv@mythbuntu:/home/jim$
>
> Jim A

The Wiki was updated yesterday. https://www.mythtv.org/wiki/XMLTV#MythTV_Setup
Thanks for the discussion (and my solution only worked 'cause I didn't use $HOME,
rather ~mythtv. Sorry for that noise.)

--
Bill
_______________________________________________
mythtv-users mailing list
mythtv-users@mythtv.org
http://lists.mythtv.org/mailman/listinfo/mythtv-users
http://wiki.mythtv.org/Mailing_List_etiquette
MythTV Forums: https://forum.mythtv.org