Creating a Watch Dog Application


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

Environment: C++, Frameworks

The accompanying code takes care of another application (call it "myApp") that should always be running.

It wakes up every X times, and checks the following:

  1. Is myApp running? If not, it turns it on.
  2. Is myApp hanging? (This is decided by myApp not consuming any CPU usage during the last X times and since the previous check.) If yes, kills it and restarts it.
  3. Is myApp already running for Y time? If yes, kills it and restarts it.

The program keeps a log file of its actions (checking, restarting, killing). It also copies the log file of myApp (if any) to another location (same name, plus date and time concatenated), so that the information in it will not get lost.

This code was compiled under VC++ 6.0. It needs the following definitions:

  • _WIN32
  • WIN32
  • _DEBUG
  • _MBCS


Download source - 3 Kb


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date