sge_shepherd provides the parent process functionality for a single Sun Grid Engine job. The parent functionality is necessary on UNIX systems to retrieve resource usage information (see after a job has finished. In addition, the sge_shepherd forwards signals to the job, such as the signals for suspension, enabling, termination and the Sun Grid Engine checkpointing signal (see for details).
The sge_shepherd receives information about the job to be started from the During the execution of the job it actually starts up to 5 child processes. First a prolog script is run if this feature is enabled by the prolog parameter in the cluster configuration. (See Next a parallel environment startup procedure is run if the job is a parallel job. (See for more information.) After that, the job itself is run, followed by a parallel environment shutdown procedure for parallel jobs, and finally an epilog script if requested by the epilog parameter in the cluster configuration. The prolog and epilog scripts as well as the parallel environment startup and shutdown procedures are to be provided by the Sun Grid Engine administrator and are intended for site-specific actions to be taken before and after execution of the actual user job.
After the job has finished and the epilog script is processed, sge_shepherd retrieves resource usage statistics about the job, places them in a job specific subdirectory of the spool directory for reporting through and finishes.
sge_shepherd also places an exit status file in the spool directory. This exit status can be viewed with qacct -j JobId (see it is not the exit status of sge_shepherd itself but of one of the methods executed by sge_shepherd. This exit status can have several meanings, depending on in which method an error occurred (if any). The possible methods are: prolog, parallel start, job, parallel stop, epilog, suspend, restart, terminate, clean, migrate, and checkpoint.
The following exit values are returned:
<execd_spool>/job_dir/<job_id> job specific directory