The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Q&A: Why Doesn’t AlwaysUp Restart my Application?

Q&A: Why Doesn't AlwaysUp Restart my Application?
  My company uses AlwaysUp to run 4 applications on our lab server. Every few weeks, one of the applications stops running and I have to log in and restart it. Why doesn’t AlwaysUp automatically restart it?

Here is what I see in the logs:

AlwaysUp not restarting: Activity

— Sandy

Hi Sandy, thanks for reaching out. The whole point of using AlwaysUp is to keep your application running 24/7/365 so you are right to be puzzled!

Before digging into the details, let’s review the basics of AlwaysUp.

How AlwaysUp works (a quick summary)

When you configure an application in AlwaysUp, a true Windows Service is created. Let’s call it the AlwaysUp service.

For example, if you setup Dropbox in AlwaysUp, you will see an AlwaysUp service called “Dropbox (managed by AlwaysUpService)” in the Services utility:

Dropbox (managed by AlwaysUpService)

When your computer boots, the AlwaysUp service:

  1. Starts before anyone logs in

  2. Launches your application

  3. Constantly monitors your application, quickly restarting it if it crashes or dies for any reason.

The AlwaysUp service is the key to running your application 24×7.

(If you are curious to find out more about the inner workings of AlwaysUp, check out our detailed How AlwaysUp Works explainer.)

What your logs tell us

The activity report shows AlwaysUp running your application continuously for a few days. Then at 7:03:11 AM, your application suddenly stops. And soon after, the AlwaysUp service stops as well.

Your application is not crashing or failing in any way. No errors or warnings were reported and nothing out of the ordinary occurred.

From that benign sequence, we can conclude that someone (or something) intentionally stopped your AlwaysUp service.

And with the service stopped, the only way to restart your application is to restart the AlwaysUp service.

Who stopped your AlwaysUp Windows Service?

Unfortunately the logs don’t say who (or what) stopped the service.

However, there are at least 4 ways that the service could have been stopped:

  1. From the Services application.

    For example, clicking the Stop button will terminate the AlwaysUp Dropbox service:

    Stop the service
  2. With the NET STOP command.

  3. With the SC STOP command.

  4. From an application leveraging the Windows Services API.

Do you know who would stop the service?

Are there any batch files that manipulate services?

Watch out for maintenance scripts and other background tasks.

Investigate with Windows Service Auditor

If it’s time to put your detective hat on and figure out who’s stopping the service, our free Windows Service Auditor tool should be able to help. It will record all operations performed on the AlwaysUp service.

After downloading and starting Windows Service Auditor, enable extended auditing for the AlwaysUp service. Periodically review the service’s security events, watching for “Stop the service” operations, like this:

Windows Service Auditor: Stop event

Good hunting!

Keep the service running with Service Protector

If you are unable to prevent the service from shutting down, consider deploying Service Protector as a second layer of defense.

Install Service Protector, select Protector > Add and choose your AlwaysUp service from the list:

Select your AlwaysUp service

After you save, Service Protector will babysit the AlwaysUp service — to quickly restart it if someone stops it:

Service Protector protecting the AlwaysUp service

Hopefully you will get to the bottom of this unwelcome behavior soon. Please be sure to get in touch if you notice any errors or warnings in the activity reports.

Posted in AlwaysUp | Tagged , , , , , | Leave a comment

Leave a Reply

Your email address will not be published. Required fields are marked *