[mythtv] code for user jobs only in front end?

Paul Paul paul2004 at writeme.com
Fri Dec 29 03:54:35 UTC 2006


 >> The frontend doesn't run jobs. If you want to run any jobs on the
frontend.

Thanks, Chris.

Actually, no, I don't want to run jobs on the front end.  They should run
on the back end that does the recording.  The problem is that the back
end won't run user jobs; I created the user jobs as per the instructions,
and the back end won't run them.  I posted messages in the users list, as
well as on mythtvtalk, but nobody had an answer.  Which is why I started
digging into the code to try to solve it.  And that's when I discovered
that the code: SLOT(doBeginUserJob1())); exists only on the front end;
not on the back end.  (which didn't make sense to me)  But in fact I
grep'd all the source code for the back end and can't find anywhere that
it launches user jobs.  Could you tell me where in the back end code it's
supposed to start user jobs, so I can dig into why it's not working?  I
only started digging into the code because this original post to the
users list was without a solution:

I have a bash script I want to be run when a recording has finished.  I
added the user jobs in mythsetup, and when it didn't work, kept tweaking
the settings table directly, but with no luck.  Here is what I've got: 
select * from settings where value like '%userjob1%':
JobAllowUserJob1      1      mythbox
UserJob1    /usr/sbin/SaveMythRecording.sh %CHANID% %STARTTIME% %DIR%
%FILE%  mythbox
AutoRunUserJob1      1      mythbox
UserJobDesc1     My user job       mythbox

NOTE: I also added another set of duplicate records with hostname=null. 
In my "record" table autouserjob1 is "1" for all shows.  And I confirmed
in mythweb that it is checked.  I've tried reloading the front end and
back end.  And I've confirmed the permissions on the script allow
execution (ie -rwxr-xr-x).  The bash script just contains a simple:
#!/bin/bash
echo "$(date) $0-$1-$2-$3-$4" >> /home/donerecording.log

so I will know when the script is being run (my home directory has full
permissions).  But that file is never created.  In my mythbackend.log
when a recorded program is over there is no mention of the user job:
2006-12-18 18:30:00.568 TVRec(1): Changing from RecordingOnly to None
2006-12-18 18:30:01.236 Finished recording Chinese News: channel 1008
2006-12-18 18:30:01.251 Reschedule requested for id 0.
2006-12-18 18:30:01.443 Finished recording Chinese News: channel 1008
0: start_time: 0.036 duration: 161.760
1: start_time: 0.026 duration: 161.739
stream: start_time: 0.289 duration: 1797.440 bitrate=5203 kb/s
2006-12-18 18:30:02.063 AFD: Opened codec 0x824daa0, id(MPEG2VIDEO)
type(Video)
2006-12-18 18:30:02.058 Scheduled 1 items in 0.8 = 0.61 match + 0.19
place
2006-12-18 18:30:02.098 AFD: Opened codec 0x824ca40, id(MP2) type(Audio)

Anybody have any ideas?  Thanks for any help.





  ----- Original Message -----
  From: "Chris Pinkham"
  To: "Development of mythtv"
  Subject: Re: [mythtv] code for user jobs only in front end?
  Date: Thu, 28 Dec 2006 01:20:31 -0500


  * On Mon Dec 25, 2006 at 05:07:02PM -0500, Paul Paul wrote:
  > I posted the message below to the mythtv-users list and mythtvtalk
  forum
  > and myth-dev lists that with myth .20 it's not running the user
  jobs. I
  > didn't get replies and am digging into the code to see where it's
  broken,
  > but am new to myth's code. I found the following calls which would
  seem
  > to start the user jobs:
  >
  > programs/mythfrontend/playbackbox.cpp:
  > SLOT(doBeginUserJob1()));
  > programs/mythfrontend/playbackbox.cpp:
  > SLOT(doBeginUserJob1()));

  The frontend doesn't run jobs. If you want to run any jobs on the
  frontend, you need to either run mythbackend or mythjobqueue on the
  same
  machine as mythfrontend. It would be easy enough to add code to have
  the frontend run the JobQueue as well, but it would also require some
  logic added to default jobs to off for frontend-only machines so the
  user would have to explicitly turn them on. I made a note in my TODO
  about this, but it's not high on my priority list since mythjobqueue
  exists.

  Wherever you want to run them, you need to run mythtv-setup to allow
  User Jobs to run on that particular host. But that is a -users
  question and has been answered many times over so for more info look
  in
  the -users list archives for howto instructions.

  --
  Chris
  _______________________________________________
  mythtv-dev mailing list
  mythtv-dev at mythtv.org
  http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

-- 
___________________________________________________
Search for products and services at:
http://search.mail.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mythtv.org/pipermail/mythtv-dev/attachments/20061228/1f0a512f/attachment.htm 


More information about the mythtv-dev mailing list