SvcWatchDogClientDemo is a demonstration project showcasing the integration of a Python application with SvcWatchDog. It doesn't have any other useful function.
The objective was the same as for the NotificationServer project.
A time.sleep(9999999)
(for example) should be detected throughout the code.
This basically means that no matter where the code freezes, SvcWatchDogClient or SvcWatchDog will detect it and make sure the application is restarted, ensuring that the service is always available.
The basics are exactly the same as for the NotificationServer project.
If your're interested, search for TimeoutDetector
and SvcWatchDogClient
in the code to see how the monitoring is implemented.
Preparation steps:
- Make sure the demo works if you start it from command line (
python svc_watch_dog_client_demo.py
). Install required Python modules if needed. - Download SvcWatchDog - binary or source, it's up to you
- Customize
scripts\pack.bat
to match your SvcWatchDog folder - Run
pack.bat
to prepare the distribution folder (dist) - copy dist contents to your preffered location
Installation steps (Admin credentials required):
- install service:
service\SvcWatchDogClientDemoService -i
- start service:
net start SvcWatchDogClientDemoService
- stop service:
net stop SvcWatchDogClientDemoService
- uninstall service:
service\SvcWatchDogClientDemoService -u
Once the service runs, you can experiment with the ping_enabled
parameter in the dummy_thread
section of the configuration file (etc/SvcWatchDogClientDemo.ini
).
Both this demo and SvcWatchDog generate detailed log files, which you are encouraged to review.
This project relies on the following Python modules:
- pywin32: Needed for monitoring of SvcWatchDog's named win32 event.
- pytest: Only needed for testing.
If you have any questions about the demo, I encourage you to open an issue on GitHub. In case you would like to contact me directly, you can do so at: mt.dev[at]gmx.com .