Users manipulate jobs in different ways, after a job has been submitted. It can be suspended, resumed, killed, or sent arbitrary signal jobs.
All applications that manipulate jobs are subject to authentication provisions.
Users can send signals to submitted jobs. If the job has not been started, you can send KILL, TERM, INT, and STOP signals. These signals cause the job to be cancelled (KILL, TERM, INT) or suspended (STOP). If the job has already started, then any signal can be sent to the job.
The following example takes a job ID as the argument and sends a SIGSTOP signal to the job.
/******************************************************
* The program takes a job ID as the argument and sends a * SIGSTOP signal to the job
******************************************************/
#include <stdio.h>#include <lsf/lsbatch.h>#include <stdlib.h>#include <signal.h>int main(int argc, char **argv){/* check if input is in the right format: "simbstop JOBID" */if (argc != 2) {printf("Usage: %s jobId\n", argv[0]);exit(-1);}/* initialize LSBLIB and get the configuration environment */if (lsb_init(argv[0]) < 0) {lsb_perror("lsb_init");exit(-1);}/* send the SIGSTOP signal and check if lsb_signaljob()runs successfully */if (lsb_signaljob(atoi(argv[1]), SIGSTOP) <0) {lsb_perror("lsb_signaljob");exit(-1);}printf("Job %s is signaled\n", argv[1]);exit(0);}
On success, the function returns 0. On failure, it returns -1 and sets lsberrno to indicate the error.