Make Windows services auto-restart if closed

Encountered bit of an issue with FreeProxy – it started to crash every few weeks. I suspect faulty hardware, some other service crashed as well.

Anyway I found it strange that it runs in service mode and doesn’t restart after crash. Later I remembered that services must be deliberately set to auto-restart mode if that wasn’t part of initial settings.

Services console

Windows console to manage services can be accessed by Control Panel > Administrative Tools > Services (may be unavailable, depends on user account) or by executing services.msc from command line.

services_console

Service recovery

Service properties have Recovery tab that defines behavior for when service is closed or crashed in inappropriate way.

services_properties_recovery

It allows to set different action for first, second and subsequent failures. Actions themselves are:

  • restart service;
  • restart computer;
  • launch program of choice (with option to add fail count as parameter).

Overall

I know that there are some third party apps that monitor and restart services. As for me native Windows settings are quite robust and well integrated with event log as well.

Related Posts