[mythtv] Crash in ~DVBChannel() - Wiki comments

Roger James roger at beardandsandals.co.uk
Fri May 19 06:47:07 UTC 2017

On 18 May 2017 5:57:43 pm Bill Meek <keemllib at gmail.com> wrote:

> Hi Roger,
> I looked at the Wiki. Suggest removing the: Environment=HOME=/~/.mythtv line
> because tilde expansion doesn't seem to work in the .service files. Plus,
> you've set User=mythtv and that will set HOME to (in my opinion) the proper
> value of /home/mythtv. I suspect you didn't want the leading slash either.
> I just now read about BindsTo=, that's interesting, I need to try it out. 
> My only
> concern is that it sounds like a mysql failure mid-recording would stop the 
> recording.
> I prefer to use mythbackend --quiet... on the ExecStart line.
> That way systemd isn't getting any output that needs to be redirected with
> the StandardOutput and StandardError lines, so I don't have them either. And
> like you, I prefer --logpath. Users of --syslog would want --quiet too so
> as not to get double logging in the journal. I'm thinking that for the
> average user, --syslog might be a better choice so they don't have to worry
> about configuring logrotate etc.
> The filename, /etc/systemd/system/mythbackend.service has potential problem.
> If a user *somehow* gets Mythbuntu's .service, it will be in
> /lib/systemd/system/mythtv-backend.service and since the names are different,
> both would be started. I'd suggest naming it: 
> /etc/systemd/system/mythtv-backend.service.
> I really like the concise version you've added. Always thought the
> other one was getting too long (and I've seen users copy it verbatim
> rather than adjusting it.)
> Just my 2 cents. I'd be happy to make changes, but don't want to stomp on
> your work without getting your opinion.
> Full disclosure, I'm still learning about systemd.
> On 05/18/2017 06:25 AM, roger wrote:
> ...
>> I have updated the systemd page in the mythtv wiki with an example that 
>> stops the database being shut down before the backend is. It also logs
>> stderr to the systemd journal and runs mythbackend with the core resource 
>> limit set to infinity (N.B. this setting is further constrained by the
>> rlimit of whatever user id the backend is set to up to use, in this case 
>> "mythtv").
> --
> Bill

Hi Bill,

I never looked closely at that HOME= line. I started from the sample conf 
file and deleted the irrelevant bits. I just took the second of the two 
HOME= lines and copied it across. You are quite correct, there only 
substitution that goes on here is systemd specifiers, the shell is not 
involved, and as you point out the leading / would stop it working even in 
the shell! I will remove it.

I chose to use BindTo because loss of the database causes serious problems 
to mythbackend. It will cause mythbackend to be terminated if the database 
goes away.

The logging stuff is just my preference. I was thinking  of moving the 
ExecStart line into its own drop in conf file in a mythbackend.service.d 
directory, to make it easier to edit parameters without having to touch the 
main unit file.

Mythbackend uses logging to stderr in circumstances when the logging 
mechanism may not be available. This is mostly at startup and shutdown. I 
like to use systemd's journal facility to capture this.

I will add a note about the mythbuntu unit file.

Feel free to edit whatever you see fit. That it what wikis are for 😀.


More information about the mythtv-dev mailing list