MIGRATE — User Commands
NAME
migrate − Migrate a command to another machine
SYNOPSIS
migrate [−BbvlD] [[−h host] | [−H hostID]] [−p processID] [(−E cmd arg0 | cmd) args ...]
INTRODUCTION
This command is used to execute commands remotely using the Sprite process migration facility. It may be used to execute commands on a particular machine or to select from idle machines; and it may execute a command specified by the arguments to the migrate program, or an interactive shell.
SELECTING A HOST
−BThe −B specifies that the host should be selected at “background” priority, rather than at the priority used for other tasks such as compilations.
−h
−HBy default, a host is selected from among the idle hosts available on the local network. This host is then marked as being in use for the duration of the command being executed; the host will not be chosen for remote execution of other processes in the meantime. If a host is specified with the −h or −H options, then the “in-use” flag is bypassed; this is useful when invoking migrate as a “remote login” facility to execute commands directly on another host. The −h flag specifies a host by name, and the −H flag specifies it by spriteID (thereby bypassing the host database lookup to convert from name to internal numeric identifier).
−lIf no host is specified and no idle host is available, the command is not executed unless the −l option is specified, in which case the command is executed locally. The “−l” option similiarly affects the disposition of the command if migrating to the other host fails.
EXECUTING A COMMAND
To execute a single command remotely, the command may be specified by placing the command and its arguments after any options to migrate. If no command is specified, an interactive shell is created. If the SHELL environment variable is present, that shell is invoked, otherwise csh is invoked. In any case, the exit status from the subprocess is returned by migrate.
−E command
In some circumstances, programs may be invoked with argv[0] different from the name of the command. In this case, the -E option may be used to specify the name of a file to execute, and the first argument after the option list specifies the value of argv[0]. Otherwise, argv[0] is set to the name of the command that is invoked.
MIGRATING A CURRENT PROCESS
−pTo migrate a process that is already executing, invoke migrate with the −p option, giving the process ID of the process to migrate (in hex notation). Each process must be migrated individually, in separate runs of migrate.
OTHER OPTIONS
−bThe −b option may be used to enter “background mode”, in which migrate executes a command and returns immediately, printing the process identifier of the migrated child. Thus,
migrate xyzzy&
is different from
migrate -b xyzzy.
The process identifier for the former case is printed by the shell, and it corresponds to the migrate process; while the process identifier in the latter case corresponds to the migrated child itself. In the former case, normal csh job control may be used to foreground and background the migrated child, but in the latter case, the process is not controlled by csh.
−vThe −v option may be used to enter “verbose mode”, in which case the host selected for migration is printed, or a message that no host could be selected is printed if the command is executed locally due to the −l option.
−DThe −D option enables “debug mode”, which causes various debugging statements to be printed as the program executes.
SEE ALSO
migrate, db, xload, pmake, loadavg, csh, ps
FILES
/sprite/admin/data/migInfo - the global migration database file.
KEYWORDS
process migration, load average, uptime, idle time, database, remote execution
BUGS
If a process that is executing remotely is evicted when that machine is no longer available, the process will continue to execute locally. This is nearly completely transparent to the user (ps -m will no longer show the process as migrated). Even if the host were not selected as an “idle host”, the migrated process can be evicted if the other host goes from being available to being unavailable.
If another host is selected at random to migrate a process that is already running, when that process exits the remote host, the remote host will remain flagged as “in use” for a short period of time. This is because the migrate process cannot conveniently wait for a process that isn’t its child.
Sprite version 1.0 — April 03, 1991