[mythtv-users] I broke my mythTV, help!

Douglas Peale Douglas_Peale at comcast.net
Fri Nov 9 17:22:48 UTC 2018


On 11/8/18 10:43 PM, Stephen Worthington wrote:
> On Thu, 8 Nov 2018 22:02:19 -0800, you wrote:
>
>> I have been attempting to run scripts as the mythtv user. There is a good chance I'm using sudo incorrectly, but below is what I
>> attempted and the result.
>>
>> I hope this is a clue:
>>
>> $ sudo -H -i -u mythtv checklogin.sh
>> sudo: unable to change directory to /home/mythtv: Permission denied
>> sudo: unable to execute /bin/sh: Permission denied
>>
>>
>> checklogin.sh is the script I use to see if anyone is logged in before allowing mythtv to shutdown the system.
> That is seriously wrong.  The /home/mythtv directory should exist and
> be group and user mythtv.  Being unable to change to the /home/mythtv
> directory when you are user mythtv says that it has the wrong
> ownership.  Or does not exist.  And that would also explain why
> mythbackend running as user mythtv is unable to access things under
> /home/mythtv.
>
> I would do this to fix the ownership and permissions:
>
> sudo chown mythtv:mythtv /home/mythtv
> sudo chmod u=rwx,g=rx,o=rx /home/mythtv
>
> And then you need to check the ownership of files and directories
> under /home/mythtv also.  Mostly, they should be ownership
> mythtv:mythtv also, unless you have some special files (eg using
> sudoers).
>
> But I am not sure why you are getting permissions problems with
> /bin/sh.  The /bin/sh executable is normally a link to /bin/dash, and
> dash is normally readable and executable by anyone.
>
> If you want to do commands like "sudo -i", I would recommend doing
> this command:
>
> sudo chsh -s /bin/bash mythtv
>
> to set the mythtv user's shell to /bin/bash instead of /bin/sh.
>
> After that, what does this command show:
>
> sudo -H -i -u mythtv env
> _______________________________________________
> 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
>
$ sudo chown -h mythtv:mythtv mythtv
$ ls -l
rwxrwxrwx  1 mythtv mythtv   53 Nov  4 16:50 mythtv -> /mnt/f9d5db19-7551-41dd-ba43-9c07f0a8305e/home/mythtv
$ sudo -H -i -u mythtv env
sudo: unable to change directory to /home/mythtv: Permission denied
sudo: unable to execute /bin/sh: Permission denied


Nope, changing the user and group of the soft link was not sufficient to fix the problem.


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20181109/faaef977/attachment.sig>


More information about the mythtv-users mailing list