[mapguide-users] Check if service is running?

Andy Morsell amorsell at spatialgis.com
Wed May 3 18:59:56 EDT 2006


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
 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 7014 bytes
Desc: not available
Url : http://lists.osgeo.org/pipermail/mapguide-users/attachments/20060503/c0217d10/winmail.bin


More information about the Mapguide-users mailing list