Check if service is running?

Andy Morsell amorsell at spatialgis.com
Sun May 7 13:07:16 EDT 2006


After having the modified version running on my production server for several
days, I have discovered that my service lockups are not detected by this
script.  I did quite a bit more experimentation on my locked up server (I
can lock it up in a two step operation with the FDO raster provider) and
here is what I discovered when the service is in it's locked up state:

I can establish a site connection
I can create a session
I can create a resource service
I can create a feature service
I can create a mapping service

However, as soon as a I try to get a runtime map from an existing map
definition, it fails.  But, when it fails, it just stalls with no errors and
nothing is ever returned so a Try, Catch does not do anything.

For now, I'm back to restarting the service every couple of hours through a
scheduled task.

Andy




Andy Morsell wrote:
> 
> Thanks for supplying this to the group Jason.  I installed it and made
> some
> tweaks according to my environment and now have it running.  I am using a
> scheduled task running every two minutes to check the health.  I am also
> writing a log file to an HTML page so will keep an eye on it to see how
> often restarts are necessary.
>  
> For some reason it was not finding my webconfig.ini file in it's own
> directory.  I found that I had to make this change to make it work:
>  
> $configFilePath = 'C:\Program
> Files\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini';   
> MgInitializeWebTier ($configFilePath);
>  
> For those interested (particularly those running Windows 2000), here are
> the
> tweaks I made.  In the second try block, this is the only line: 
>  
> exec('c:\restart_MapGuide.bat');
>  
> I already had this batch file created from my older process.  The contents
> of that batch file being called are:
>  
> c:\pskill mgserver
> c:\psservice stop "MapGuide Server"
> c:\psservice start "MapGuide Server"
> echo MapGuide restarted %date% %time% "<br>" >>
> c:\inetpub\wwwroot\restart_MapGuide_log.htm
> 
> pskill and psservice can be downloaded from sysinternals.com
>  
> 
> Andy Morsell, P.E. 
> Spatial Integrators, Inc. 
> http://www.SpatialGIS.com 
> 
>   _____  
> 
> From: Jason Birch [mailto:Jason.Birch at nanaimo.ca] 
> Sent: Monday, May 01, 2006 11:45 PM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] Check if service is running?
> 
> 
> Well, I made some headway on this, but ran into a bug along the way:
>  
> https://mapguide.osgeo.org/servlets/Scarab?id=MG269
>  
> I could have sworn that I had reported this earlier, but I couldn't find
> it
> in the PT.  Basically NET START "MapGuide Server" does not work because of
> a
> name conflict with the "Server" service.  Anyone else see this?  The SC
> command (possibly another XP/2k3-specific command) appears to work because
> it only accepts the service name.
>  
> You can download a draft PHP CLI health monitoring utility here:
> http://www.jasonbirch.com/files/mghealthmonitor.zip
>  
> Note, this utility is probably XP/Win2k3-specific. Let me know what you
> think.
> 
> Jason
> 
>   _____  
> 
> From: Jason Birch [mailto:Jason.Birch at nanaimo.ca]
> Sent: Mon 2006-05-01 3:02 PM
> To: users at mapguide.osgeo.org
> Subject: RE: [mapguide-users] Check if service is running?
> 
> 
> I wish Windows had the same kind of consistent command line tools that
> unix
> does.  I'm trying to think of a way to deal with this across
> Win2k/XP/Win2k3, but short of using the Sysinternals tools I'm drawing a
> blank.  ps and grep would really come in handy.
>  
> - The Windows KILL command doesn't appear to have a mechanism for
> identifying the process ID beforehand.  
>  
> - The TASKKILL command appears to have everything we need, but it isn't
> available in 2000
>  
> I think I'm going to take the easy way out and use TASKKILL, with
> alternate
> instructions for downloading and using pskill.
>  
> Jason
>  
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe at mapguide.osgeo.org
> For additional commands, e-mail: users-help at mapguide.osgeo.org
> 

--
View this message in context: http://www.nabble.com/RE%3A-Check-if-service-is-running--t1539555.html#a4270924
Sent from the OSGeo MapGuide forum at Nabble.com.





More information about the Mapguide-users mailing list