Ssh
From SRB
Contents |
NAME
Ssh - Invokes the SRB shell.
SYNOPSIS
Ssh [-v][-c] [command]
DESCRIPTION
The Ssh command executes commands (both normal UNIX commands and S-commands) read from a terminal or a file.
The primary goal for the design of Ssh is to reduce the client/server connection overhead of S-command (the family of SRB command such as Sinit, Sls, Sput, Sget, etc). Currently, after initializing with the Sinit command, each S-command can be run as an independent UNIX command. Within each S-command, a new connection to the SRB server is created at the start of the command and the connection is disconnected at the end of each command. The standalone Scommand model is simple and easy to use. However, the overhead of creating a SRB client/server connection is relatively high, especially on the server side. The high connection overhead causes lag time in command response especially when the network latency between client and server is high, and consumes resources of the servers.
The Ssh provides a shell for executing the S-commands such that all commands use the same SRB connection to communicate with the SRB server. Other UNIX commands (binary and shell script) can also be run within the shell.
Like other shell commands, Ssh can be in interactive mode which reads and executes commands from a terminal or can be used to issue a single command or shell script using the "-c command" option.
Unlike other shell commands, Ssh does not have its own scripting language but shell script files written for other shells can be executed by Ssh.
Before running the Ssh command, the client's SRB environment (.MdasEnv and .MdasAuth files) must be setup first (see the Sinit manpage for SRB environment setup). The Sinit command does NOT need to be run before running Ssh since Ssh carries out is own initialization. The Ssh can be started by typing in "Ssh" which puts the shell in interactive mode. The shell begins reading and executing commands from the terminal after the prompt "Ssh >". A "exit" or "quit" command will end the Ssh shell.
Internally, the Ssh uses other shell programs to interpret and execute the input commands (read from the terminal). The default shell is "sh". Other shells that work with Ssh include "bash" and "ksh". "csh" and "tcsh" do NOT work with Ssh because they seem to close all opened file descriptors before executing the input commands. Hence the socket connection to the SRB server will not be passed on to the input commands. The environment variable SRB_SHELL can be used to set the shell used by Ssh. If it is set to NO_SRB_SHELL, the Ssh will use the fork() and exec() calls to execute the input commands.
Another way to to start up an Scommand interactive session is to use the Ssh command to run an interactive shell, e.g.,
Ssh -c bash
An interactive bash shell session will be started with this command and the SRB socket connection created by Ssh will be passed onto the bash shell. All Scommands executed in this bash shell will use this socket connection to communicate with the SRB server. The advantage of this approach is the full capability of the interactive shell will be maintained. The socket connection to the SRB server is maintained until the shell is terminated. The Sexit command will not terminate the connection. Also, in this mode, if a CTRL-C key stroke is used to terminate a Scommand, the socket connection to the SRB server will be left in an unknown state and the interactive shell should be terminated and restarted. A better process termination handling in Ssh will be incorporated in future releases.
The Ssh can be used to issue a single command or shell script using the "-c command" option. e.g.,
Ssh -c myShellScript
where myShellScript can be a shell script written in "sh", "bash", "ksh" or "perl". The advantage of using Ssh is that a socket connection to the SRB server is only created once and all Scommands in the script use this connection to communicate the the SRB server which greatly reduces the connection overhead. Since all Scommands in the script use the same socket connection, it is NOT advisable to run these Scommands in the background because they will be competing for the same socket connection.
OPTIONS
- -v
- Display the client and server release versions. Same output as Sinit.
- -c
- Execute a single command or script specified by [ command ]


