Control hosts and daemons

The user can control the hosts and daemons through lsb_hostcontrol() and lsb_reconfig().

lsb_hostcontrol() opens or closes a host and restarts or shutdowns the slave batch daemon.

int  lsb_hostcontrol (struct hostCtrlReq *);
struct hostCtrlReq {    char  *host;             Host to be controlled    int    opCode;           Option for host control    char  *message;          Message attached by the admin
};

If host is NULL, the local host is assumed.

lsbatch.h defines the opCode parameter containing the following control selection flags:

HOST_CLOSE

Closes the host so that no jobs can dispatched to it.

HOST_OPEN

Opens the host to accept jobs.

HOST_REBOOT

Restart the sbatchd on the host. The sbatchd will receive a request from the mbatchd and re-execute itself. This permits the sbatchd binary to be updated. This operation will fail if no sbatchd is running on the specified host.

HOST_SHUTDOWN

The sbatchd on the host will exit.

HOST_CLOSE_REMOTE

MultiCluster — Closes a leased host on the submission cluster

In order to use updated batch LSF configuration files, the user can use lsb_reconfig() to restart the master batch daemon, mbatchd.

int  lsb_reconfig (struct mbdCtrlReq *);
struct mbdCtrlReq {    int    opCode;          Options for configuration    char   *name;           Reserved for future use    char  *message;         Message attached by the admin };

The parameter opCode is defined in lsbatch.h and should be one of the following:

MBD_RESTART

Restarts a new mbatchd

MBD_RECONFIG

Reread the configuration files

MBD_CKCONFIG

Check validity of the mbatchd configuration files

lsb_reconfig() provides the following functionality to:

  • Dynamically reconfigure an LSF batch system to pick up new configuration parameters

  • Change to the job queue setup since system startup or the last reconfiguration

  • Restart a new master batch daemon

  • Check the validity of the configuration files.

On success, both lsb_hostcontrol() and lsb_reconfig(). On failure, they return -1 and set lsberrno to indicate the error.