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

Joe Ripley vitaminjoe at gmail.com
Tue Dec 11 14:43:29 UTC 2007


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.

-- 
Joe Ripley
vitaminjoe at gmail.com


More information about the mythtv-users mailing list