• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Executing commands remotely

Zach

Diamond Member
I have two webservers, and I need to execute commands on one system by running scripts on another (for setting up accounts). What's the best method? I don't even know what to look for in the How-To's. I'll be using Perl mostly, and I've chatted with a guy doing simaler things by binding scripts to specific ports. Security is a concern, but I have a backend network using non-routable IP's..

What's the best method? Without any help I'd just be setting up cron jobs to look for changes on the 'main' system via nfs mounts and coordinating settings through that. Oh, and I should mention that I'm running Linux (Redhat 7).
 
Can you use rlogin from perl? I don't know for sure with Linux, but that's what we did with our Unix systems.
 
Well, the wonderful thing about UNIX is that there are probably hundreds of ways to do this.

Here's some ideas:

- rexec/rsh: These aren't used very often anymore I think, but they will do exactly what you want. See "man rcmd" for more information.
- Code a simple daemon (perl is fine) that listens on some port, accepts connections from only your other machine and does some simple text negotiation to get the parameters and then just executes the script (or runs the code inside the daemon). Then code a client for talking to that daemon for your other box.

 
Don't know how good I'd be at making daemons in perl to listen to ports. Hopefully I can use or hack something already out there... never looked for it before but also never seen it.
 
People have done this stuff so much I'm sure you'll be able to make us of existing code. Go search freshmeat for some perl daemons.
 
Back
Top