Sponsored Content
Full Discussion: rexec() function problem
Top Forums Programming rexec() function problem Post 12748 by lcmoreno on Monday 7th of January 2002 11:01:38 AM
Old 01-07-2002
Question rexec() function problem

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 password for a given username, rexec fails, it's ok. But my program keeps trying to connect calling rexec function, so if I change the password for that user in the host to the password that rexec is giving, it should connect successfuly, but I keep getting the same login error. The curious is if I restart my program or even if I finish the thread and start the thread again it connects succesfully.

I think it's a bug in rexec, does anyone had a problem similar to that and can help me.

Due to that problem I'm writing a code just to restart the threads that failed in rexec, but it's getting much more complex than it should be.


Thanks in advance for any help.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

expect (re: rexec)

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)
Discussion started by: yatno
1 Replies

2. UNIX for Dummies Questions & Answers

Enabling Rexec ????

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)
Discussion started by: raichuu
1 Replies

3. Solaris

Rexec

How is rexec enabled on a Solaris 8? How can I check if rexec is installed? (1 Reply)
Discussion started by: pmj1970
1 Replies

4. UNIX for Advanced & Expert Users

reagrding REXEC command

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)
Discussion started by: rahul26
2 Replies

5. Shell Programming and Scripting

How can I do a rexec to execute un C exe ?

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)
Discussion started by: Lika
4 Replies

6. UNIX for Advanced & Expert Users

Remote commands problem using RSH & Rexec

I have enabled the RSH and Rexec command in my HP-UX server but when i try to send any command to the server it returns Execute Permission Denied except commands like ls-l C:\rsh xxx.xxx.xxx.xxx -l mpac mxpkill 12 the mxpkill command work when I log to the server using telnet with the same... (0 Replies)
Discussion started by: fhuwaidy
0 Replies

7. UNIX for Dummies Questions & Answers

exit codes from rexec?

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)
Discussion started by: diego_sapphire
4 Replies

8. AIX

rexec - other options?

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)
Discussion started by: ioniCoder
4 Replies

9. UNIX for Advanced & Expert Users

Rexec Issue

Hi Team, I am executing some ksh scripts which inturn calls java files in AIX Environment. We have installed java6_64 which is in .profile. But when we execute from rexec its taking path from some different place that does not have java in $PATH variable. Can you please help me find out which... (2 Replies)
Discussion started by: balasubramani04
2 Replies

10. Red Hat

Slow login with rexec.

Hi all, I´m replacing an old linux enterprise redhat 4.5 by a new one linux enterprise redhat 6. In both I use rexec as a communication between the front end and the user. In the old one, when the user connects, the communication establishes quickly (less than 3 sec). But in the new one, the... (1 Reply)
Discussion started by: mig28mx
1 Replies
REXEC(1)						      General Commands Manual							  REXEC(1)

NAME
rexec -- remote execution client for an exec server SYNOPSIS
rexec [ -abcdhns -l username -p password ] host command DESCRIPTION
Rexec calls the rexec(3) routine to act as a client for the remote host's rexecd(8) server. It asks that ``command'' be run on the host computer, using username/password authentication. See rexec(3) and rexecd(8) for details of the protocol. OPTIONS
Rexec accepts several options, but only three are likely to be very useful: -l username Set the log-in name on the remote host to username. -p password Provide the password for the remote account. The command line argument will be blanked after being parsed, to prevent it from being seen with ps(1). However, it is still not very secure to type the password on the command line. In particular, be sure that the shell's history file is protected. -n Explicitly prompt for name and password, even if provided in the environment, in the $HOME/.netrc file, or in the environmental variables REXEC_USER and REXEC_PASS. Other options that might be useful with non-standard remote exec daemons, or to debug connections: -a Do not set up an auxiliary channel for standard error from command; the remote standard error and output are then both returned on the local standard output. By default, rexec asks that a separate channel be set up for diagnostic output from the remote command. -b Use signal handling as in BSD rsh(1). Only the signals SIGINT, SIGQUIT, and SIGTERM are echoed to the remote process. They do not remain raised locally, so rexec waits for the remote command to shutdown its side of the socket. Also, CNTRL-Z will only suspend execution locally--the remote command may continue to run. -c Do not close remote standard input when local standard input closes. Normally the standard input to the remote command is closed when the local standard input is closed. -d Turn on debugging information. In particular the command sent to the remote host will be echoed. -h Print a usage message. -s Do not echo signals received by the rexec onto the remote process. Normally, signals which can be trapped are passed on to the remote process; then, when you type CNTRL-C, the remote process terminates as well. USERNAME AND PASSWORD
Rexec(1) searches for the username and password in the following order: 1. If -n is given on the command line, the user will always be prompted for both, even if they are also given on the command line. 2. The command line will be parsed 3. If the environmental variables REXEC_USER or REXEC_PASS are defined, they will define the username or password. 4. The $HOME/.netrc file will be searched. See ftp(1) for a description of this file's format. 5. Finally, the user will be prompted if either the username or password remains undefined. SECURITY
Users of this command should be aware that rexec(3) transmits their password to the remote host clear text, not encrypted. If the network is not secure to the remote host, the password can be comprimised. SIGNALS
Without the -b option, all signals which can be handled are echoed to the remote process. Afterwards, however, they remain raised in the local process. Typically, this means that rexec(1) will exit after receiving a fatal signal, even if the remote process has arranged to handle or ignore it. Differing operating systems use differing signal numbers; for example AIX and SunOS use 18 for SIGTSTP (^Z), while Linux uses 20. There- fore, it may have a different effect remotely than locally. In particular, typing CNTL-Z may not suspend the execution of the remote process. EXAMPLE
rexec othermachine cat ">remote_file; date" <local_file will send local_file to the othermachine as remote_file. BUGS
Please send bug reports, system incompatibilities, and job offers to the author. SEE ALSO
rexec(3), rexecd(8), rsh(1) AUTHOR
Michael Sadd mas22@cornell.edu http://www.tc.cornell.edu/~sadd/ Thanks to Orange Gopher (2/10/97) and Johannes Plass (plass@dipmza.physik.uni-mainz.de, Oct. 17 1996) for useful suggestions. February 14, 1997 REXEC(1)
All times are GMT -4. The time now is 01:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy