O great holders of all Wisdom that is Perl, hear a petition from I, a humble grasshopper...
I am attempting to accomplish a small task using the Win32::Service. This task is:
- Stop a service on my server.
- Export specific data from the application for backup, using a pre-written script provided by the vendor.
- Restart the service.
My issue is that when I stop the service, Win32::Service reports the service as stopped (status 0x01), but Windows shows the process is still running until it completely shuts down. If I kick the export off while the process is still running, it will fail. How can I validate that the process is stopped before moving on? This must be a commonly-asked question, but I haven't been able to find the answer.
JAPG (Just Another Perl Grasshopper)