[mythtv] [PATCH] Changing channels in the background
Chris Bagwell
chris at cnpbagwell.com
Thu Mar 3 01:35:06 UTC 2005
On Wed, Mar 02, 2005 at 12:40:04AM -0500, Isaac Richards wrote:
> On Tuesday 01 March 2005 10:13 pm, Chris Bagwell wrote:
> > Gist of patch: Do a double fork() and immediately exit from first
> > fork(). This will deamon-ize the external channel changer. Had to do a
> > third fork() to allow the timeout cleanup code to keep working.
>
> Why not just add a & to the changer command line?
Thanks to the mailing list, I've learned that recently,
mythtv CVS was actually using & for the external command. I'll
try that, thanks all!
Now I've viewed channelbase.cpp history and I see its a recent feature
to detect failed change channels. So I guess its going to be hard to
convince people to add back in the & to CVS.
Actually, I may try a different approach. Instead of adding & to
mythtv, I may make a C deamon program to change channels using lirc.
This way I don't have to load up a shell or get the overhead
of running irsend multiple times.
Speaking of loading a shell, is there any reason why
channelbase.cpp is running "/bin/sh -c" in the execl()?
execl() will look at the first line of the file and
load /bin/sh or whatever is needed.
Unless your using a feature of /bin/sh like the &, it would seem
better to just execute the script directly (better for the
binary deamon anyways).
Chris
More information about the mythtv-dev
mailing list