We have installed java6_64 which is in .profile. But when we execute from rexec [...]
Well, a users .profile is executed every time the user logs in. "rexec" is not a login, hence .profile is not executed.
Instead of putting these settings in .profile put it in ~/.kshrc, make it executable and explicitly load a ksh in the script to make sure a ksh is started:
In http://forums.unix.com/showthread.php?threadid=391
there is one statement called expect.
but when I issue command whereis expect, respond from o/s only EXPECT: (only one world).
I try to find it at /usr/bin, no expect statement there ?
is it default unix o/s command ?
I am using AIX on... (1 Reply)
Hi folks,
I'm trying to make a reconnection algorithm using rexec(), but I noticed that when rexec() fails returning -1, it is impossible to make it run successfully again until you restart the program or the thread.
Example, I have a endless loop for connection retries, if I supply a wrong... (7 Replies)
Can someone tell me how I would enable Rexec on a UNIX machine? And is the procedure different on the different systems - Solaris, HP-UX -etc.
Thanks~!!
mike (1 Reply)
Hi, all.
Could some one help me please with one problem?
In one process (on aix) I should run some remote scripts on other server via rexec.
Some scripts should be run on server1 under useridA, and some scripts should be run on the same server under useridB.
I specified in .netrc... (10 Replies)
Hi UNIX gurus.....
have a doubt..can i run a script in a remote machine by using something like
rexec add.corp.afg.com /aa/ss/remtescript
I dont want to use the rsh command due to some security issues.
thanx,
rahul26 :) (2 Replies)
Hello,
I would like to do a rexec to execute a C exe (prog.e) :
rexec -l user -p password host prog.e
When I execute this command, I have this error :
prog.e : can not find lib.o
But, When I execute prog.e directly in the remote machine : well done ! No error output.
Thks for your... (4 Replies)
how do i/is there a way to return the exit code from the remote host?
echo $? from the local host only gives 0, if the rexec command itself executes successfully. But what if in the case of the remote command failiing? echo $? on the localhost still gives 0, but I'm interested in the exit code... (4 Replies)
Rexec executes commands one at a time on a remote host. The rexec command provides an automatic login feature by checking for a $HOME/.netrc file. User and password are stored
in $HOME/.netrc.
I would like to log on to another host and execute a script/command but not using $HOME/.netrc file,... (4 Replies)
Hi,
I am trying to enable rexec to automate certain tasks(it has to be rexec, not ssh or any other due to the system environment), so after switching to linux, I followed the certain instructions that were laid out in the web.
My operating system is fedora 17, so I first installed the... (1 Reply)
Discussion started by: wringer
1 Replies
LEARN ABOUT OSF1
rexec
rexec(3) Library Functions Manual rexec(3)NAME
rexec, rexec_r - Allow command execution on a remote host
LIBRARY
Standard C Library (libc.a)
SYNOPSIS
#include <netdb.h>
#include <unistd.h>
int rexec( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc);
The following function is supported in order to maintain backward compatibility with previous versions of the operating system. int
rexec_r( char **host, int port, char *user, char *passwd, char *command, int *err_file_desc, struct hos-
tent_data *host_data);
PARAMETERS
Contains the name of a remote host that is listed in the /etc/hosts file or /etc/resolv.conf file. If the name of the host is not found in
either file, the rexec() fails. Specifies the well-known Internet port to use for the connection. A pointer to the structure that con-
tains the necessary port can be obtained by issuing the following library call: getservbyname("exec", "tcp") Points to a user ID that is
valid on the host. Points to the password of the specified user ID on the host. Points to the name of the command to be executed at the
remote host. Specifies the file to which standard error from the remote command is sent.
If the err_file_desc parameter is 0 (zero), the standard error of the remote command is the same as standard output. No provision is made
for sending arbitrary signals to the remote process. In this case, however, it may be possible to send out-of-band data to the remote com-
mand.
If the err_file_desc parameter is nonzero, an auxiliary channel to a control process is set up, and a descriptor for it is placed in the
err_file_desc parameter. The control process provides diagnostic output from the remote command on this channel and also accepts bytes as
signal numbers to be forwarded to the process group of the command. This diagnostic information does not include remote authorization
failure, since this connection is set up after authorization has been verified. Per-thread data for reentrant version.
DESCRIPTION
The rexec() (remote execution) function allows the calling process to execute commands on a remote host.
If the rexec() connection succeeds, a socket in the Internet domain of type SOCK_STREAM is returned to the calling process and is given to
the remote command as standard input and standard output.
The user and passwd parameters specify a valid user ID and the associated password for that user on the remote host. If the user and
passwd parameters are not supplied, the rexec() function takes the following actions until finding a user ID and password to send to the
remote host: It searches the current environment for the user ID and password on the remote host. It searches the user's home directory
for a file called $HOME/.netrc that contains a user ID and password. It prompts the user for a user ID and password.
Note that action 3 does not apply when using rexec_r().
NOTES
The rexec_r() function is the reentrant version of rexec(). It is supported in order to maintain backward compatibility with previous ver-
sions of the operating system. The netdb.h header file defines the hostent_data structures.
RETURN VALUES
Upon successful completion, the system returns a socket descriptor to the remote command. Otherwise, a value of -1 is returned, indicating
that the specified hostname does not exist.
FILES
Contains hostnames and their addresses for hosts in a network. This file is used to resolve a hostname into an Internet address. Contains
the name server and domain name. Contains automatic login information.
RELATED INFORMATION
Functions: getservbyname(3), rcmd(3), rresvport(3), ruserok(3).
Commands: rexecd(8). delim off
rexec(3)