[mythtv-users] User Jobs, Exit Codes and myth_archive_job.pl

Ma Begaj derliebegott at gmail.com
Tue Dec 11 18:36:08 UTC 2007


2007/12/11, Joe Ripley <vitaminjoe at gmail.com>:
> On Dec 11, 2007 5:26 AM, David Whyte <david.whyte at gmail.com> wrote:
> > I use the myth_archive_job.pl perl script to archive files to a
> > secondary disk and have automated the task as a user job that is run
> > after *every* recording.
> >
> > The problem I am getting is that the job queue reports that the
> > archive job is successful even when the script fails because there
> > isn't enough space in the disk.
> >
> > I have updated the script to make sure it returns an exit code of 1
> > (instead of the -1 code that was being returned), however, this still
> > reports as successful even when the disk is full.
> >
> > Does the jobqueue use the script exit codes to report success or
> > failure?  How else do the built in jobs like mythtranscode and
> > mythcommflag work?
>
> I don't think MythTV checks the exit code of the user job.  As far as
> the code goes, Myth checks if the UserJob script exists and is
> executable, and that's about it.  As soon as the UserJob script
> returns, the code (jobqueue.cpp in libmythtv) reports 'Successfully
> Completed.'
>
> I had problems with this in the past as well with my on UserJobs.  I
> ended up just patching the code to remove the 'Successfully Completed'
> stuff.  My script updated the database with the true exit status of my
> UserJob anyway... the code in libmythtv was overriding my exit status
> info.
>

There is a "status" column in the mysql table "mythconverg.jobqueue".
This column is actually your status code.

Check this: http://www.mythtv.org/wiki/index.php/Jobqueue_table

And here is a nice explaination (cpinkham):
http://www.gossamer-threads.com/lists/mythtv/users/276801#276801


M.


More information about the mythtv-users mailing list