Knowledge Center         Contents    Previous  Next    
Platform Computing Corp.

ls_rexecve()

Executes a program on a specified remote host.

DESCRIPTION

This routine is for executing remote tasks. It is modeled after the UNIX fork and execv system calls.

ls_rexecve() executes a program on the specified remote host. The program name is given in argv[0] and the arguments are listed in argv. This routine is basically a remote execv. If a connection with the Remote Execution Server (RES) on host has not been set up previously, ls_connect() is invoked to automatically establish the connection. The remote execution environment is set up to be exactly the same as the local one and is cached by the remote RES server.

ls_rexecve() is the same as ls_rexecv() except that it provides the support of setting up a new environment specified by the string array **envp. When envp is a NULL pointer, it means using the remote RES server's cached environment, otherwise using the new one. A minimal default environment (HOME, SHELL, USER, and PATH) is initially cached when a remote execution connection is established and the cached environment is updated whenever the remote execution environment is changed by ls_rsetenv() or any of the routines on this man page.

The caller of this routine is typically a child process which terminates when the remote task is over. This routine does not return if successful. It returns -1 on failure.

Any program using this routine must call ls_initrex() first.

Any program using these routines must be setuid to root if LSF_AUTH is not defined in the lsf.conf file.

The remote file operations documented in ls_rfs() make use of a Remote File Server on the remote host. When this RFS shuts down, its status will be reported to its client. The client should ignore this status.

SYNOPSIS

#include <lsf/lsf.h> 
int ls_rexecve(char *host, char **argv, int options, 
                       char **envp) 

PARAMETERS

*host

The remote host where the program is executed.

**argv

The program being used.

options

The options value is constructed by ORing flags from the following list:

REXF_USEPTY

Use a remote pseudo-terminal.

REXF_CLNTDIR

Use the local client's current working directory as the current working directory for remote execution (see ls_chdir()).

REXF_TASKPORT

Request the remote RES to create a task port and return its number to the LSLIB. The application program can later call ls_conntaskport() to connect to the port.

REXF_SHMODE

Enable shell mode support if the REXF_USEPTY flag is also given. This flag is ignored if REXF_USEPTY is not given. This flag should be specified for submitting interactive shells, or applications which redefine the ctrl-C and ctrl-Z keys (e.g., jove).

**envp

RETURN VALUES

None

Function was successful.

integer:-1

Function failed.

ERRORS

Systems that conform to the Single UNIX specification are not required to detect error conditions for this function. - Error handling

SEE ALSO

Related APIs

ls_rexecv()

ls_rtask()

ls_rtaske()

ls_control()

ls_chdir()

ls_conntaskport()

ls_rstenv()

ls_initrex()

ls_rfs()

Equivalent line command

none

Files

${LSF_ENVDIR-/etc}/lsf.conf


Platform Computing Inc.
www.platform.com
Knowledge Center         Contents    Previous  Next