[mythtv-users] mythbackendpre.log permissions
Ian Evans
dheianevans at gmail.com
Fri Mar 15 06:55:59 UTC 2024
On Thu, Mar 14, 2024, 8:34 a.m. Stephen Worthington <
stephen_agent at jsw.gen.nz> wrote:
> On Thu, 14 Mar 2024 08:01:01 -0400, you wrote:
>
> <snip>
> Unless you specify otherwise, systemd will run everything as root.
> However, the standard mythtv-backend.service file includes this line:
>
> User=mythtv
>
> so mythbackendpre.sh will be run from user mythtv. Which means that
> you will have to do something like the touch/chown/setfacl commands to
> create the log file for it, and they need to be done as root, so could
> not be done from the mythtv-backend.service file except by using an
> sudo helper script. Which is complicated.
>
> The other alternative, which I think would be easier, would be to run
> mythfrontendpre.sh as a separate systemd unit, and then make
> mythtv-backend wait for the mythfrontendpre.service to complete before
> it is run. Then the mythfrontendpre.sh service can just be run as
> root. So you would put something like this in your
> mythtv-backend.service override files:
>
> [Unit]
> Wants=mythbackendpre.service
> After=mythbackendpre.service
>
> That is what I do with my local-network-pingable.service.
>
> Another alternative is to use the systemd journal to log to. To do
> that, you make the output from mythfrontendpre.sh go to stdout instead
> of putting it in a log file. You can then see the output by doing
> "journalctl -u mythtv-backend". I think stderr output also goes to
> the journal.
>
> Thanks again for a great explanation. Realizing it's not something I need
to check on frequently, I went with the last option you suggested and used
the journal method.
Thanks again.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mythtv.org/pipermail/mythtv-users/attachments/20240315/dfaa2651/attachment.htm>
More information about the mythtv-users
mailing list