Re: Servers on Windows?
by Corion (Patriarch) on Nov 25, 2007 at 21:43 UTC
|
If you have WMI/DCOM enabled on the Windows machines, you can launch arbitrary programs via WMI, if your account has the appropriate permissions. See the links in DBD::WMI resp. Win32::WQL.
| [reply] |
|
| [reply] |
|
If you're really desperate, I think the Samba project also includes a DCOM client, and I believe that DCOM and Sun RPC are somewhat related. But to use that as your transport you must be really desperate, as a simple self-made server is easily created depending on how secure you want it to be.
| [reply] |
Re: Servers on Windows?
by ysth (Canon) on Nov 25, 2007 at 21:46 UTC
|
I'm not clear on whether you are looking for server code (code that listens to a port and accepts connections) or code to install a windows service or both. For the former, perhaps search CPAN
for RPC - lots of choices there. (Or just start from what's in perlipc.) For the latter, I see Win32::Daemon; there may be others, too.
Search for openssh for an open source sshd, but I'm not sure what that has to do with the rest of your question. | [reply] |
|
Sorry if I wasn't clear. I am asking for a light weight RPC implementation that I can call from non-Windows systems. Preferably, small and stable. I just need to (infrequently) start a small Perl sysadm program -- and get the result back.
I have searched for open source sshd and didn't find anything except Cygwin, which isn't light weight.
This is really trivial functionality. I don't understand why it seems so hard.
| [reply] |
|
use Win32::Daemon;
# Tell the OS to start processing the service...
Win32::Daemon::StartService();
# Wait until the service manager is ready for us to continue...
while( SERVICE_START_PENDING != Win32::Daemon::State() )
{
sleep( 1 );
}
# Now let the service manager know that we are running...
Win32::Daemon::State( SERVICE_RUNNING );
followed by the single-threaded server code straight out of the perl doc at http://perldoc.perl.org/perlipc.html#TCP-Servers-with-IO%3a%3aSocket,
modified to just run your sysadm program and return its output in the
body of the accept loop.
(Untested...) | [reply] [d/l] |
Re: Servers on Windows?
by cdarke (Prior) on Nov 26, 2007 at 08:57 UTC
|
Are you sure you actually mean RPC and not IPC? Windows RPC (Remote Procedure Calls) uses its own implementation of DCE RPC which is generally not compatible with others. COM is implemented using Windows RPC, and so are a lot of Windows services (usually invisible to end-users). Although I have seen DCE RPC implemented on other systems, like Linux, personally I have never been able to get it working with Windows (that might have been me, of course). IPC (Inter-Process Communication) is much simpler, depending on what you want to do. | [reply] |
|
I meant RPC, not Windows RPC. I have some servers where I need to start some simple sysadm scripts periodically and want to keep it as light as possible. Hence, no Cygwin, etc. (Without having to install a Visual C++ and compiling up a Service program.)
Sigh, Thanks for info re DCE RPC implementations on Linux. :-(
| [reply] |
|
| [reply] |
|
Re: Servers on Windows?
by jbert (Priest) on Nov 26, 2007 at 12:10 UTC
|
One option would be to tunnnel the request through an existing protocol the server is running. You could:
- Invoke a CGI on a web server (just start job if it's long running)
- create a flag file in a (hidden, locked down) directory on a file server, checked every N mins by a scheduled job on the server.
Bit crufty, but should work easily (and both methods provide good auth support, which you'll presumably want). | [reply] |
Re: Servers on Windows?
by BerntB (Deacon) on Nov 26, 2007 at 14:00 UTC
|
In the end I went with WinSSHD (over FreeSSHd). If it works the coming weeks, we'll use that. Otherwise, I guess it'll be a Perl program.
Thanks for the help, insight and input!
| [reply] |