When you return a removed host to a cluster, you need to reboot the host’s LIM. When you reboot the LIM, the configuration files are read again and the previous LIM status of the host is lost.
The following code example demonstrates how to reboot a host’s LIM using ls_limcontrol():
/******************************************************* LSLIB -- Examples** ls_limcontrol()* Shuts down or reboots a host’s LIM.******************************************************/#include <lsf/lsf.h>#include <io.h>#include <stdlib.h>#include <stdio.h>int main(int argc, char ** argv){int result; /* returned value from ls_limcontrol*/int opCode; /*option*/char* host; /*host*//* Checking for the correct format */if (argc !=2){fprintf(stderr, "usage: sudo %s <host>\n", argv[0]);exit(-1);}host = argv[1];/* To reboot a host, assign LIM_CMD_REBOOT to the opCode */opCode = LIM_CMD_REBOOT;printf("Restarting LIMon host <%s>\n", host);result =ls_limcontrol(host, opCode);/* If there is an Error in execution, the program exits */if (result == -1){ls_perror("ls_limcontrol");exit(-1);}/* Otherwise, indicate successful program execution */else{printf("host <%s> has been rebooted. \n", host);}/*Reboot is successful and the program exits */exit (0);}
To use the above example, at the command line type:
where hostname is the name of the host you want to return to a cluster.