473,395 Members | 2,443 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

disconnecting rsh session

Hi,

I want to be able to tail -f log files on a different machine and display
the results in a web page. Below code from the cgi works:

$cmd = "rsh -l $acc $Host tail -f $LogFileName |";
$count=0;
open LOG, $cmd or die "Could not open file: $!";
while (<LOG>){
$_ =~ s/\&/&amp;/g;
$_ =~ s/\</&lt;/g;
$_ =~ s/\>/&gt;/g;

print "$_";
last if (count++ >100);
}
exit;
However; problem is that I can not end the session! If for example a user
clicks stop; or closes the window, on the target machine, I still see
'tail -f $LogFileName' under $acc user...

It looks like the above cgi does not stop neither the rsh connection.

Did anyone do something like this? How is it possible to close the
connection?

Adil
Jul 19 '05 #1
1 4113
In article <wJ********************@comcast.com>, sc0ri0n
<sc*****@hotmail.com> wrote:
Hi,

I want to be able to tail -f log files on a different machine and display
the results in a web page. Below code from the cgi works:

$cmd = "rsh -l $acc $Host tail -f $LogFileName |";
$count=0;
open LOG, $cmd or die "Could not open file: $!";
while (<LOG>){
$_ =~ s/\&/&amp;/g;
$_ =~ s/\</&lt;/g;
$_ =~ s/\>/&gt;/g;

print "$_";
last if (count++ >100);
}
exit;
However; problem is that I can not end the session! If for example a user
clicks stop; or closes the window, on the target machine, I still see
'tail -f $LogFileName' under $acc user...

It looks like the above cgi does not stop neither the rsh connection.

Did anyone do something like this? How is it possible to close the
connection?


You are trying to abuse the HTTP protocol, which normally is a
request-response action and not a long-term connection.

You could try using a client-pull and periodically refresh the page
with the current contents of the log file. See some HTTP tutorial or
reference on how to do that. See also this article on how to do this in
Perl: <http://www.stonehenge.com/merlyn/LinuxMag/col39.html>.

FYI: this newsgroup is defunct. Try comp.lang.perl.misc in the future
(but keep in mind that your question is more about HTTP and rsh than
Perl).
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= East/West-Coast Server Farms - Total Privacy via Encryption =---
Jul 19 '05 #2

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

Similar topics

0
by: phoenix | last post by:
Hi, i'm using a dsl connection to surf the internet. I use the following code to connect to the internet : // Check if already connected if (InternetAttemptConnect(0) != 0) return false;...
7
by: Andreas Håkansson | last post by:
Hello, I'm building a small TCP based server which uses the Async commands. When a new connection is made to the server, I store the new socket in a hashtable, using the client IP as the key. ...
13
by: Joner | last post by:
Hello, I'm having trouble with a little programme of mine where I connect to an access database. It seems to connect fine, and disconnect fine, but then after it won't reconnect, I get the error...
0
by: joseph conrad | last post by:
Hi, I tried to implement my own session handler in order to keep control on the process the drawback I foun it is not creating and storing in my cookie the PHPSESSID variable anymore. reading te...
14
by: aroraamit81 | last post by:
Hi, I am facing a trouble. I have some Session variables in my code and somehow my session variables are getting mixed up with other users. For example User A has access to 10 companies and...
7
by: aroraamit81 | last post by:
Well Guys, Here is a very strange trouble. When more than one users request tto same page at the same time then our session gets conflicted. Moreover I printed my SessionID, strangely but true I...
1
by: salvagedog | last post by:
We use xp_smtp_sendmail for all emailing from SQL Server. Occasionally it fails, generating the following message: Error: disconnecting from server mail.mydomain.com failed The failures are...
5
by: lyealain | last post by:
<% If Session("username") = "" Then Response.Redirect("/CLS/Login.asp") End If Dim conn Dim connectstr Dim db_name, db_username, db_userpassword Dim db_server Dim res
3
by: =?Utf-8?B?UmludSBHb3BhbGFrcmlzaG5hIFBpbGxhaQ==?= | last post by:
Hi All, I have a ASP/C# application that connect to Oracle database . After issuing my SQL query if I close the browser or move into another page ( ie whle executing in the databse serevr) will...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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,...

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.