473,804 Members | 3,031 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problems with rlogin and executing a script

Hi all

I work with Suse Linux 8.2 and Python 2.2.2
I'm trying to make a python script which makes a rlogin to another
system and executes there another script. So it looks like this:

os.system("rlog in <hostname>")
os.system("./myscript.py")

The rlogin is ok. I can give in my password and i'm on the other host.
But the script goes not on until i exit the rlogin. How can a execute a
command on the new machine on which i'm logged in?
Jul 18 '05 #1
2 4328
Lukas Schnieper fed this fish to the penguins on Wednesday 01 October
2003 12:59 am:

os.system("rlog in <hostname>")
os.system("./myscript.py")
Won't work.

EACH os.system() call is the equivalent of opening a new command
interpreter window. So what you have is the first call doing the remote
login, and then exiting, followed by the second os.system() creating a
new environment and trying to execute locally.
The rlogin is ok. I can give in my password and i'm on the other host.
But the script goes not on until i exit the rlogin. How can a execute
a command on the new machine on which i'm logged in?
Check the various popen family. Though you may have to write the
entire sequence first before you can read the returns...

-- =============== =============== =============== =============== == <
wl*****@ix.netc om.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
=============== =============== =============== =============== == <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #2
Lukas Schnieper <sc*******@sema for.ch> wrote in message news:<ma******* *************** ************@py thon.org>...
Hi all

I work with Suse Linux 8.2 and Python 2.2.2
I'm trying to make a python script which makes a rlogin to another
system and executes there another script. So it looks like this:

os.system("rlog in <hostname>")
os.system("./myscript.py")

The rlogin is ok. I can give in my password and i'm on the other host.
But the script goes not on until i exit the rlogin. How can a execute a
command on the new machine on which i'm logged in?


It looks like your calling myscript.py from your local system, not the
remote system. You should probably try the Pexpect module (
http://pexpect.sourceforge.net/ ), which will let you control a
command line program like rlogin or ssh.
Jul 18 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
3316
by: Markku Uttula | last post by:
I think I'm doing something wrong. I'm able to connect to Oracle just fine, execute queries and all, but I'm having serious problems with the speed :( For example, the following PHP-script on my machine executes about 6 seconds: <? $db_conn = ocilogon("my_username", "my_password", "my_database"); $loop_count = 1000;
2
4809
by: walala | last post by:
Dear all, I recently came across a Python program which used "telnetlib" to automate things in the several unix machines in our local networks; I attached the script as follows; I wonder if it is possible to have the equivlent libary for "rlogin" in Python? Because our local networks support only SSH or RLOGIN. This script used Telnet so it could not be used in our local networks;
0
1967
by: Nick Coghlan | last post by:
Anyone playing with the CPython interpreter's new command line switch might have noticed that it only works with top-level modules (i.e. scripts that are directly on sys.path). If the script is inside a package, the invocation will fail with a "Module not found" error. This PEP is aimed at fixing that :) Cheers, Nick.
0
1650
by: David H | last post by:
Background. I'm running on WinXP w/ MS Services for Unix installed (to give rsh/rlogin ability), both Python 2.3 and 2.4 version. In linux, I'm running RHEE with python2.3 version. The code below works fine for me in linux, but in WinXP the popen*() command "hangs". More specifically, I get an apparent python prompt (without the '>>> ', but whatever I type has no effect, and hitting return does a CR but not the additional LF, so I...
1
2156
by: Bryan Hesters | last post by:
I'm trying to build a Win32 application that will log into a PBX via RLogin. I'm not very versed in protocol programming and all the examples I can find on the internet are either linux based (GNU Inet Utils) or require about $2k (Power TCP, etc.) Can someone point me towards a reference or library that would help me establish a terminal session and build a simple application that will allow me to interface with this system? I will be...
4
12684
by: chris.dunigan | last post by:
I'm looking for an example of how to execute an existing DTS­ package from an ASP (VB)script and would appreciate any and all response. ­I don't even know if it's possible Thanks - Chuck Gatto Dan Guzman Apr 27 2000, 12:00 am show options
55
4220
by: drhowarddrfine | last post by:
I'm working on a web site that could use some control using js but am concerned about what problems I may have with potential users having their js turned off. Has anyone had any serious problems with this sort of thing? I know some of these potential users are with big companies and am wondering if anyone had real problems with that.
0
467
by: Ian Warford | last post by:
Hi, I have a problem with a PL/PerlU function trying to execute an external perl script. The script is suid to a non-root user and I am executing it in the PL/PerlU function as so : $rc = system "/usr/bin/suidperl", "-T", "/usr/local/bin/script.pl";
0
1685
by: Sebastien Dupont | last post by:
Hi, I'm having a problem with executing a subprogram from a Python script. The subprogram is written in VBS (os = Win Server 2003). When I execute the Python script manually, the VBS script works perfectly :) . When I execute the Python script through the Windows scheduler, the VBS script doesn't launch :( . More precisely, it doesn't launch under a normal windows user, but it works under an administrator windows account. It is...
0
9706
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10571
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10317
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10075
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9143
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7615
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3815
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.