There are some Win32 modules that could come in handy for this.
Win32::Service <- List, start, stop services
Win32::Eventlog <- Assuming that it writes to the event log
If all you want to do is restart the service when it crashes, you can do that from within Windows - just set the recovery option on N failure to restart the service. Why bother reinventing a fully functional wheel?
You may also want to check the ActiveState Mailing Lists for people that have done this sort of thing before. Particularily the perl-win32-admin list. | [reply] |
Due to *some Microsoft* problem (according to Lotus) R5 won't run as a service (like it does on every other W2K machine in the world) on my mahine. MS ((predictably) says it is a Lotus problem; so glad I pay for tech support.)
--
lmoran@wtsgSPAM.com
print "\x{263a}"
| [reply] |
Maybe invoke Lotus Notes on the server with Win32::Process::Create, then wait indefinately for it to end (i.e. via $processobject->Wait(INFINITE)). Then,
loop back to reinvoke it IF it appears to have died for a reason where you know you can just start it back up again. I.e., if it's dying for a good reason, like because a crucial file has gotten corrupted, then this sort of solution would bring the server to a screeching halt as it goes through an infinite loop of start-crash-start-crash-start-crash. Maybe only restart it depending on the value of Win32::GetLastError.
Disclaimer: I know bupkiss about both Lotus Notes,
and Win32 servers. You might want to
check out Dave Roth's books and web site; he's written some books on using Perl for Win32 Administration.
-- Frag. | [reply] |
it took me 5 reads to get what you were saying (b/c I am, despite test scores in the mid 80s, dumb) but now that I have grasped what you are saying this IS BETTER than monitoring it! I will begin on this immediately.
I own Dave Roth's book on Win32 Perl Sys Admining and I will use it to implement this idea thank you!
--
lmoran@wtsgSPAM.com
print "\x{263a}"
| [reply] |
| [reply] |