Printable Version of Topic

Click here to view this topic in its original format

Linuxhelp _ General Discussion _ mount?

Posted by: elen Aug 14 2006, 07:48 AM

hi everyone,

where should i look for this issue ...

i am writing a program that needs to run another program on *another* machine on my network. am i right that i need to look at the 'mount' command??

thanks.

Posted by: DS2K3 Aug 14 2006, 01:52 PM

The mount command puts a storage device into the filesystem/strcutre of the computer - So no.

You can connect to a remoate computer using telnet or ssh, one or other must be running on the computer that you want to conenct to (the server) and yu need to have the relevant client installed on your computer. Which distribution are you using on each computer, and what are you trying to achieve?

D

Posted by: Jim Aug 15 2006, 12:41 AM

I am gonna back up D here, not that he needs it.

Likely what you need is ssh, but that depends on what you're trying to do.

If you have computer called foo, that needs to trigger a program on computer barr you can run this

foo #> ssh barr runCommand

where foo #> represents a promt on foo

That will run the program runCommand on barr. So say its like a backup script, that will cause the script to be executed on barr.

But I think what you want to do is something where you have a program on barr that you want to run ON foo not from foo.

That is far more difficult. Unless there is some major reason you can't, you are far better off installing the program on foo. If you absolutely had to run the binary from barr, you would have to share out the volume on barr using something like NFS, then mount that volume on foo so you could do foo #> /mnt/barr/bin/runCommand from foo. There are a lot of reasons why this would be difficult to do and really tricky. You would have to be aware of all the libraries its gonna use, and what its reading and writing from.

Like I said, you're far better off installing the program on foo and just running it locally. If you still don't understand, or still have questions, tell us what you want to do and we will definitely help you out.

Let me give you an example to try to help you out.

I have this backup script that I wrote. I run the script from my main server that copies everything to my backup server, but before I can copy everything over, the old backup needs to be moved, and things need to be cleaned up.

So, on my backup server I have a script called rotateBackups, and I run that script from my backup script with this command

ssh backup /usr/sbin/roateBackups

The script runs on my backup server, does everything I need, then after its done, my backup script continues on with the backup. If you're looking to achive something like that, ssh is your man.

You can even do cool stuff like this example.

We have a script that runs on one of our boxes and collects a list on banned IP addresses. Those IP address need to get dropped into our firewall so they can be blocked. You can use a pipe to ssh to pass the list.

/usr/sbin/listBanned | ssh firewall addBannedIPs

listBanned shoots out IPs to be banned one per line, and addBannedIPs reads them in one at a time and drops them into our firewall rules. Its pretty nice. ssh is amazingly powerful.

Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)