RCMD(X)

NAME
rcmd - run a remote command in the background, without stdin, stdout, stderr.

SYNOPSIS
rcmd remotehost [ -l user ] [ command ]

DESCRIPTION
Rcmd runs the given command on the specified remotehost via rsh but by redirecting stdin, stdout and stderr to /dev/null, and feeding the given command to the Bourne shell (/bin/sh) in the background, it results in the rsh exiting and closing the connection, leaving the command as a daemon on the remote machine. This is useful only for commands that have no use for stdin, stdout and stderr like most applications for the X Window system.

It passes the TERM environment variable to the remote shell. It also passes the DISPLAY environment variable, unless DISPLAY is not defined or is :N or unix:N, in which case it passes `hostname`:N.

If rcmd is run from the same machine as the one on which the X server is running, then it will run an xhost command to add the remotehost to the access list. (xhost may not be run from remotehosts, so you'll have to do it yourself if you run rcmd on a remotehost, for another remotehost)

If command is not provided as an argument, rcmd reads the standard input and feeds it to the remote shell. So something like
	rcmd remotehost << EOF
	xterm -ls &
	xclock &
	xpostit &
	EOF
will start a remote xterm, xclock and xpostit in the background on the remotehost. This is much faster than using a separate rcmd or rsh for each command. But an ampersand (&) must be put after each command or the xclock will only start after the xterm finishes, which is probably not what is intended.

Of course, these commands could be stored in a shell script at the remote end, and run with
	rcmd remotehost shellscriptname

OPTIONS

-l user
    Runs the remote shell as user on the remote host rather than as yourself.

EXAMPLES
rcmd godzilla.eecg /local/bin/X11/xterm -geometry 80x50+3-3 -ls
rcmd church.csri -l xwindows /local/bin/X11/xpic

will run xterm on the remote machine godzilla with the display on the current HOST (assuming the environment variable HOST is set to `hostname`).

BUGS
The remote command has no way of notifying the user about error conditions, except through logs. A particularly annoying problem is if the user has the DISPLAY wrong, or the host is not in the server's access list, (via xhost) nothing will happen. If the .rhosts or hosts.equiv files aren't set up to allow you permission for rsh on the remote host, you'll get a "Permission denied" error.

All bugs associated with rsh Users with a C-shell or derivative as their login shell will find rsh takes very long -- this is a feature of C-shell startup.