Kick off process on another server...

Hi Everyone,

Not sure if this is possible but here it goes…

When people register on our website I need our web server to tell another machine to run a Perl script… I can of course schedule the Perl Script to run every 10 minutes or so, but it would be nice if it was dynamic, so that it only ran as needed.

Any ideas?


It’s probably simpler and more reliable just to run the script every 10 minutes instead of setting up a cross-machine execution. If there is no work to do, then little machine time is wasted. In fact if checking if there is work is cheap, just run it more often.

But if that’s what you want to do, there are lots of choices ranging from a remote ssh execution to calling a SOAP method.

I’ll do it with sockets, a socket server listening and a client connected to send the command to execute. Sockets programming and IPC in general are very simple with perl, you should try.
Once I had a similar problem in another context, a provisioning server. I had implemented the client-server concept but with mails. I sent a mail (to the server) containing the command to run, pretty much easy. The reliability with this is that the order always comes, even if there was a problem with the connection, the mail is queued and soon or later it will arrive.

Thanks everyone for their replies…

That sounds neat… I did sockets with Java once and they were very handy. I might try them with Perl

Mails are safer and can be encrypted. Communication between two computers using sockets through Internet is dangerous.
Consider the implementation of a basic authentication (at least).