[mythtv-users] restricting mythpreviewgen?

Mike Perkins mikep at randomtraveller.org.uk
Wed Jan 23 15:30:34 UTC 2013


On 23/01/13 14:59, Alex Williamson wrote:
> On Tue, Jan 22, 2013 at 11:48 AM, Alex Williamson
> <alex.l.williamson at gmail.com> wrote:
>> On Tue, Jan 22, 2013 at 11:19 AM, Raymond Wagner <raymond at wagnerrp.com> wrote:
>>> On 1/22/2013 12:38, Alex Williamson wrote:
>>>> I can restrict other jobs to not run on this slave, can or can I not
>>>>   restrict mythpreviewgen?
>>>
>>>
>>> Mythpreviewgen is not a job that runs through the jobqueue, and thus cannot
>>> be restricted to a single host in the manner that the other tasks can. It is
>>> always run by the backend that owns that recording. Assuming your slave
>>> backend has no storage of its own, and records to shared storage on your
>>> file server/master backend, your only real option is to have something run
>>> after recording is finished to change ownership of that recording to the
>>> master backend.
>>
>> Now we're getting somewhere, thank you.  A mysql cron script wouldn't
>> be too hard.  Alternatively I was thinking about replacing
>> /usr/bin/mythpreviewgen on the slave with a script that just does an
>> rsh of the job to another system.  Your idea might be less tedious to
>> maintain though.  Thanks,
>
> This does seem to work, if I update the database like:
>
> mysql> update recorded set hostname="<master>" where hostname="<slave>";
>
> Then when I load mythweb I see mythpreviewgen running on the master.
> Next step is to figure out when it's safe to do this.  Can I do this
> while the recording is still going?  If so I could fork a job from the
> hdpvr channel change script to sleep briefly then update the database.
>   Alternatively I could just create a user job to update the database,
> with the downside being that previewgen during recording still runs on
> the slave.  But I could link mythpreviewgen to /bin/false on the slave
> and just not get previews until after the job runs.
>
I would guess that if you linked mythpreviewgen to /bin/false the slave would 
think it failed and just keep re-spawning it. Better to link it to /bin/true and 
have the slave think the job finished ok.

You might not need a cron script. Can you use mythtv events to trigger off the 
previewgen where you want it?

Also: There are a lot of other tables in mythconverg which have a 'hostname' 
column. Some of those /might/ need updating too.

-- 

Mike Perkins



More information about the mythtv-users mailing list