LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 11-20-2012, 04:48 AM   #16
bradvan
Member
 
Registered: Mar 2009
Posts: 167

Rep: Reputation: 28

Look at ssh. It is simple, well documented, secure. Not sure what else you need. The client initiates an ssh to the server and either writes to a file or scp's over a file. The server has a daemon process watching and acts when the file shows up. Simple.
 
1 members found this post helpful.
Old 11-20-2012, 05:41 PM   #17
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,991
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Quote:
Originally Posted by a2326 View Post
SNMP seems to be a good option, but it's usage seems to be quite complicated.
Heh, is that just an opinion or your practical experience actually having used SNMP? FWIW if you want "easy" then why not use a Netcat listener on the server and let the clients 'echo HELLO | nc server port' and be done with it? OTOH if you already use Xinetd (which you hinted at in one of your earlier posts) then a simple /etc/xinetd.d/ service could do as well. No need for added complexity in terms of libraries, daemons, user accounts and whatever else SSH would require.
 
1 members found this post helpful.
Old 11-21-2012, 07:43 AM   #18
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: ubuntu
Posts: 2,530

Rep: Reputation: 108Reputation: 108
Quote:
Originally Posted by a2326 View Post
I need notifications that are initiated by the client, independent of incoming files.
Earler you said:
Quote:
Originally Posted by a2326 View Post
My goal is to implement a notification service, that enables the client to notify the server immediately after he has sent him a file. When the server has received the notification, he shall read and process this file.
Maybe it's me, but as I get it, this doesn't add up. You've lost me there.
If it does add up, there must be some info missing about what it is exactly that you are trying to do. Or is it that you just want to create something that works over the network? (which can be a good argument imho)
 
1 members found this post helpful.
Old 11-22-2012, 04:31 AM   #19
a2326
LQ Newbie
 
Registered: Oct 2012
Posts: 26

Original Poster
Rep: Reputation: Disabled
To make it clear, I want to build a rcp/scp-based service, that sends files to remote users. To prevent constant polling, I need some kind of notification service for two possible situations:
1. The dispatcher sends a notification to the server after rcp/scp has returned with exit status 0. This notification starts a script on the server that immediately tries to forward the file to the receiver. If the receiver is not reachable, the server stops processing files and waits for the next external event.
2. The receiver wants to inform the server that he is now reachable and shall try again to forward the files he has stored.

I thought about using either netcat or rsh/ssh. Using rsh/ssh I could just call a remote method with the receiver name as argument.
SNMP would be a better solution, but with just a few weeks of shell programming experience maybe too complicated.
 
Old 11-22-2012, 05:47 AM   #20
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,991
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Quote:
Originally Posted by Hko View Post
Maybe it's me, but as I get it, this doesn't add up. You've lost me there.
That's exactly why I already said "Then maybe it's time you post your requirements in full" in post #6...


Quote:
Originally Posted by a2326 View Post
To make it clear, I want to build a rcp/scp-based service, that sends files to remote users.
Finally...


Quote:
Originally Posted by a2326 View Post
The dispatcher sends a notification to the server after rcp/scp has returned with exit status 0. This notification starts a script on the server that immediately tries to forward the file to the receiver. If the receiver is not reachable, the server stops processing files and waits for the next external event.
Isn't rcp / scp already exiting OK a sign the receiver already is reachable and available? In this situation you already got one channel of communication so why complicate things and add another? Doesn't make sense to me.


Quote:
Originally Posted by a2326 View Post
The receiver wants to inform the server that he is now reachable and shall try again to forward the files he has stored.
This really could be any sender / listener combo ranging from having a simple Xinetd listener and the client doing 'echo -en "READY\n"|nc sender_ip port;' to having snmptrapd listening and the client sending something like 'snmptrap -v2c sender_ip public '' .1.3.6.1.4.1.2789.2005.1 s "READY";'.


You might dislike Rational, RUP, Scrum, Agile, 6 Sigma, Lean or whatever but regardless of the methodology one choses to fsck things up with work with, regardless of the size and scope of a project and regardless if it being done instinctively or formally, there will be a stage at which a rough inventory of must haves / could haves / nice to haves gets converted to functional requirements which in turn get converted into technical requirements.
Quote:
Originally Posted by a2326 View Post
SNMP would be a better solution, but with just a few weeks of shell programming experience maybe too complicated.
If it takes you a about a week to post "I want to build a rcp/scp-based service" then with all due respect SNMP being "maybe too complicated" is not the problem.
 
1 members found this post helpful.
Old 11-22-2012, 06:08 AM   #21
a2326
LQ Newbie
 
Registered: Oct 2012
Posts: 26

Original Poster
Rep: Reputation: Disabled
All messages are sent to a mediator server (that is supposed to be always reachable), that then sends them to the endpoint (that is supposed to be not always reachable), the final receiver. Basically the way most instant messengers work. I'm sorry for my incomplete description.

Last edited by a2326; 11-22-2012 at 06:21 AM.
 
Old 11-22-2012, 06:50 AM   #22
unSpawn
Moderator
 
Registered: May 2001
Posts: 26,991
Blog Entries: 54

Rep: Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743Reputation: 2743
Thanks for the clarification. Kind of reminds me of the Blackberry "push" method. Since I notice you don't have any questions left I'll sign off and wish you good luck with your project.
 
  


Reply

Tags
networking, rsh, server


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Detect Remote Logins Within Shell Script JRomeo Linux - Newbie 1 04-19-2011 08:10 PM
a shall script for remote shell execution ramesh14 Linux - Newbie 3 03-27-2011 07:59 AM
How to call Shell Script on a remote server with remote servers env variables need Linux - Server 1 10-14-2009 08:37 PM
Cannot run shell script on the remote server haresh_dba Linux - General 2 04-14-2007 09:26 AM
telneting remote machine from a shell script sanjith11 Programming 11 05-26-2004 06:50 AM


All times are GMT -5. The time now is 06:53 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration