The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation


Q & A: Why Doesn’t AlwaysUp Send Email When My Server Boots?

Q & A - AlwaysUp Not Sending Email
  I’m using AlwaysUp to run Google Backup and Sync. I only receive emails when I manually stop and start the service — NOT WHEN my server restarts. I’m positive that all the settings are correct after double checking with one of my other installations that works fine (I have 2 licenses). What is the problem?

— Hassan Asif

Hi Hassan, sorry to hear of the trouble! We have seen this with one customer before, so we have a potential fix.

The problem: AlwaysUp is starting before important Windows Services are ready

Ever been to a Black Friday sale? It’s like that when your PC starts — controlled chaos.

The eager shoppers are the Windows Services configured to start automatically at boot. Windows launches them as soon as possible, in well-defined waves, but as new processes fight for your computer’s precious resources (CPU, RAM, etc.) it is impossible to predict when any one service will actually be ready.

For example, let’s look at the DHCP Client service. It registers an IP address for your computer — an important step that must be completed before any network operations can succeed. But since the DHCP service is launched along with several other (equally important) services, it may be available after 10 seconds today while tomorrow it may take 12 seconds to be ready. Each boot is different, and you cannot know precisely when the service will be primed.

Since you followed our tutorial, the AlwaysUp service running your Backup and Sync is configured to participate in the “mad rush” at boot. This is usually fine, but in your case I suspect that AlwaysUp is starting up too soon — before one of the important services required for sending email is fully prepared.

We have seen this before, on a beefy machine with 16 processors and 32 GB of RAM. Is the computer experiencing the problem much faster than the one that sends email properly?

Fortunately we were able to come up with a remedy…

The solution: Delay AlwaysUp, to give email-related Windows Services more time to get ready

If our diagnosis is correct, then the fix is to make the AlwaysUp service start only after all important networking and email services are ready.

But since there is no way to know exactly when all those services will be ready, the best we can do is to remove AlwaysUp from the “mad rush” and have it start a couple of minutes later. Luckily Microsoft (and AlwaysUp) has already provided a setting that does exactly that!

To delay the launching of your AlwaysUp Backup and Sync service:

  1. Start AlwaysUp.

  2. Edit your application (by selecting Application > Edit/View).

  3. On the General tab, change the Start the application setting to Automatically, but shortly after the computer boots:

    Delay Googledrivesync service
  4. Click Save to record your change.

With that setting in place, Windows will fire up the Backup and Sync service 1-2 minutes after boot — well after the mad rush. That should be enough time for the critical services to start.

And the delay shouldn’t be a problem for Backup and Sync since it isn’t required the “instant” that your machine starts. No rush there.

Please try that and let us know how you get on!

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

Watch out for Dropbox Prompts when Running as a Service!

Dropbox prompts

Are you running Dropbox as a Windows Service? Do you rely on Dropbox to operate unattended in the background, synchronizing your important files 24×7?

If so, then be on the lookout for the new Selective sync warning dialog — a popup window that requires your confirmation whenever a file is deleted. Left unanswered, it will stop Dropbox dead in its tracks and prevent all future synchronization!

Delete from your account and all devices?

The warning was introduced in Dropbox version 51.4.66 (June 2018). It looks like this:

Dropbox selective sync confirmation popup

Checking the Don’t ask me this again box will eliminate the warning going forward — a welcome capability. It’s certainly an improvement over having to dismiss the window on each delete! Thanks you, Dropbox developers, for providing the checkbox.

But having the only control in the warning itself means that we can only make the “don’t ask” selection when the warning is triggered. And who knows if we’ll be around then?

Unfortunately Dropbox (and AlwaysUp) user howeboards has fallen victim to the prompt. He describes the situation in this support forum post:

On the server, the Dropbox account “A” as configured under AlwaysUp in “service” mode is configured to run under the same Windows administrator account as what it would be if one was to log in to the server. It is still the same user account that it is “running as” in either case with the same configuration and the same Dropbox directory location.

Because this server is hosted in Azure, is taken off-line overnight and/or might reboot, it is not ideal to have to log in to the server to make sure Dropbox is running. So the permission issue I mentioned is because an automated process deleted a file or moved a file, and no one was there to click a dialog regardless if it was running in the foreground or the background. To work around this, I have had to manually restart Dropbox in that user’s foreground session to click the dialog to make it remember it. That is just plain crazy.

Crazy indeed! We can surely do better.

Any Dropbox developers reading? Please implement one of these alternatives for future warnings

In addition to the graphical controls in the warnings, can you please include viable options for those of us running Dropbox unattended?

Here are some suggestions to avoid those unwelcome prompts:

  1. Add a specific option to the settings window

    Add a new checkbox labeled “Don’t warn me when deleting files”. Checking it would eliminate the warning without having to interact with Dropbox at some obscure time.

  2. Add a general “Don’t warn me” option to the settings window

    This broad setting would apply to all current and future warnings — not just the specific one raised in this article.

    Such a powerful control may seem reckless, but I can assure you: Many of your customers would happily avoid any confirmation that has the power to cripple synchronization for several hours!

  3. Introduce (and document) a registry value that governs the warning

    This approach puts technical folks in the driver’s seat, but with zero impact (and complexity) on the user interface.

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

How to Make AlwaysUp Restart your Program Multiple Times per Day (without using the Task Scheduler)

Restart your application multiple times per day

Earlier this month, we presented a couple of options for periodically restarting a temperamental legacy application with AlwaysUp. You can either restart once per day (via a setting on the AlwaysUp Monitor tab) or multiple times per day (using the Windows Task Scheduler).

Well, today we can offer you a third option — one that doesn’t rely on additional software, like the Task Scheduler.

By leveraging the powerful Sanity Check feature — which allows you to plug in your own failure detection system — we can get AlwaysUp to close and restart your program every few hours.

Here is an example of how to set that up:

Example: Restart OneDrive every 4 hours

For this example, we’ll work with Microsoft OneDrive — already installed as a Windows Service on our Windows 10 machine.

  1. First, create a simple batch file with these two commands:

    @echo off
    exit 1

    Save the file in your AlwaysUp installation folder, C:\Program Files (x86)\AlwaysUp. We have named our batch file “SignalRestartSanityCheck.bat”.

  2. Start AlwaysUp.

  3. Select Application > Edit/View to open OneDrive in AlwaysUp.

  4. Switch to the Monitor tab.

  5. Check the Whenever it fails a “sanity check” box mid-way down the page, and click the triple-dots button on the right:

    Setup Sanity Check
  6. In the window that comes up, enter the full path to the batch file you created in the Run field.

    And set the Every controls to 240 minutes (i.e. 4 hours):

    Configure Sanity Check
  7. Confirm and save all your changes.

Now whenever we start OneDrive as a service with AlwaysUp button (or the computer is rebooted), this sequence will play out:

  1. AlwaysUp starts OneDrive.

  2. After 4 hours have passed, AlwaysUp runs the batch file (sanity check).

  3. The batch file exits with 1, signaling to AlwaysUp that OneDrive should be stopped.

  4. AlwaysUp stops OneDrive.

  5. AlwaysUp restarts OneDrive (as specified on the Restart tab).

  6. And the cycle repeats… (go to step 2)


UPDATE: Automatically restart your application every 2, 4, 6, 8 or 12 hours — directly from AlwaysUp

AlwaysUp version 11.8 introduced the ability to restart your application much more frequently.

The new periods are available in the Every setting on the Monitor tab. Expand the drop-down to select the desired time frame:

Restart your application more frequently

Enjoy!

Posted in AlwaysUp | Tagged , , | Leave a comment

OneDrive Slow? Try Disabling Files On-Demand

Speed up OneDrive

In recent months, several customers running OneDrive as a service have complained of torturously slow uploads. Files created on a PC take a very long time to appear in the cloud. In one case, it took more than 3 days for a small Word document to show up on OneDrive’s website!

The first instinct was to suspect AlwaysUp. Perhaps running as a Windows Service had somehow crippled OneDrive. But a few tests quickly disproved that theory. The performance problem showed up even when OneDrive was started normally on the desktop, outside of AlwaysUp.

The mystery has persisted for several months but recent feedback on various forums suggest that there may be a workaround. Apparently disabling the new Files On-Demand feature often restores sanity.

What is OneDrive Files On-Demand?

Files On-Demand is Microsoft’s attempt at making more efficient use of your hard drive. Instead of automatically transferring each file in the cloud onto your PC as soon as possible, OneDrive will delay the transfer of each file until you explicitly open it.

You can turn Files On-Demand on or off from your OneDrive Settings window. Right-click on the OneDrive tray, select Settings from the menu and move to the Settings tab in the window that comes up. The Files On-Demand option appears at the bottom of the form. It appears to be on by default:

OneDrive Files On-Demand

Files On-Demand trades space for speed of access. For example, let’s say you have a 10 MB PowerPoint presentation in the cloud. Without Files On-Demand, that document will be automatically copied to your computer, immediately consuming 10 MB on your hard drive. With Files On-Demand, OneDrive will “know about” the file but will not automatically transfer it. Your hard drive stores 10 MB less — great.

But the downside of Files On-Demand becomes evident when you need to use the file. Without Files On-Demand, you simply double-click the file and away you go. The document loads quickly because it is already on your computer.

With Files On-Demand enabled, double-clicking the PowerPoint issues a command to the cloud to dynamically download the file. At best you wait a few seconds for the download to complete and the file to open; at worst you can’t retrieve the document because you are not connected to the Internet.

As contributor Craig Long points out, “Files On-Demand is for those who have limited space available or for those who only occasionally need to open a file”. It’s a fine choice for individuals/hobbyists looking to conserve precious resources.

However, please be cautious when considering Files On-Demand in a professional setting. It would be a disaster in an office where OneDrive is mapped to a shared folder because the files not downloaded would never fully show up on the shared drive!

And furthermore, as Microsoft mentions, “you cannot search the contents within online-only files because they aren’t stored on the device” — a potential deal-breaker in a commercial environment.

Complaints of slow uploads with Files On-Demand

Several folks experiencing slowness were able to speed things up by disabling Files On-Demand. Here is one data point from the popular OneDrive forum hosted by UserVoice:

I have been waiting a week for the sync to complete, speeds is about 0,2kb/sec. My internet speed is 1GB/1GB. Then I turned off “sync on demand”. BOOM!!! Speed up to 15mb/sec. A factor 75.000 faster.

“John S” had a similar comment:

I had this same issue with large upload batches from my Mac (uploading about 13GB worth of data from a prior DropBox repository into a SharePoint location on Office 365 tenant) and figured out resolution myself after unsuccessful calls to MS Support: SOLUTION: turn OFF “Files on Demand”. Once off, I got normal upload speeds.

Apparently there may be problems with the new feature.

How to disable Files On-Demand

You can easily turn off Files On-Demand by un-checking the box on OneDrive’s settings page (available by right-clicking on the tray icon). Click OK on the conformation window to commit your changes:

Disable OneDrive Files On-Demand

Hopefully this simple change will put the spring back in OneDrive’s step!

Posted in Software | Tagged , , , , | 13 Comments

Essential Windows Services: Spooler

Print Spooler

What is the Spooler service?

The Windows Print Spooler is a key operating system component that manages all printing on your computer. It is started when your PC boots and runs unattended, 24×7 as a Windows Service.

The Windows Service is named Spooler and its display name is Print Spooler. The service runs inside a process called spoolsv.exe:

Spooler Windows Service

The Spooler:

  • Runs silently in the background

  • The Spooler does not show any windows or tray icons. It is an invisible technical component that presents an Application Programming Interface (API) to programs looking to manage printing.

  • Accepts files to be printed, from all applications

  • The Spooler is always listening for print requests. It accepts documents from any application running on your computer.

    The process of handing off a document to the Spooler is called Spooling. Once an application is done spooling a document, the Spooler is responsible for the actual printing. The application can go back to its normal tasks.

    For example, let’s say you’re printing a spreadsheet from Microsoft Excel. You will notice a brief period as Excel prepares the document and hands off the print request to the Spooler. And during that time, a helpful window will announce that Excel is printing. However Excel is really sending the spreadsheet to the Spooler (i.e. spooling):

    Excel printing/spooling

    After the window has disappeared (i.e. Excel is done spooling), you will be free to edit your spreadsheet while the actual printing proceeds simultaneously. You can even close Excel! None of that matters to the Spooler, which will ensure that your spreadsheet makes it to the printer — independent of Excel.

  • Facilitates concurrent printing

  • Ever printed several, lengthy documents at the same time? The Spooler makes that possible — without overwhelming your printers.

    The Spooler maintains a queue of requests (a print queue) for each printer on your computer. When you print a document, the Spooler:

    • Adds a new item (a print job) to the print queue.
    • Sends the print job to the printer (when the printer is ready).
    • Monitors the printer as it produces pages.
    • Removes the job from the queue once the printer has produced all pages.

    Windows allows you to see (and manage) each printer’s queue. To open a print queue:

    1. Open the Control Panel (available from the Start menu).

    2. Type the word printers into the search box and click the View devices and printers link on the left:

      Find printers in Control Panel
    3. Find your printer in the list. Right click the printer and select See what’s printing from the menu:

      Select see what's printing
    4. A window showing all pending print jobs will come up. Here we see one item for Administrator — a text file printed from the Notepad application:

      The print queue window

      From there, you can cancel all print jobs (“clear the queue”), pause a specific job or stop printing altogether.

  • Will do everything in its power to ensure that documents are printed

  • The Spooler’s mission is to make sure that all your documents are printed — even if there is a brief outage or interruption.

    For example, if your printer temporarily disappears from the network, the Spooler will wait a reasonable time for the device to come back before declaring a failure.

    And if your request to print a single page is stuck behind a 200-page behemoth, the Spooler will ensure that your document gets its turn, eventually.

What happens if I stop the Spooler service?

Nothing can be printed when the Spooler service is stopped. And if you try to print without the service running, Windows will insist that no printers are installed:

No printers when Spooler is stopped

Indeed, when the service is running, printers show up as ready and waiting. Printing works fine:

Spooler service running, printers connected

But all printers become inaccessible the instant the service is stopped:

Spooler service stopped, printers not connected

Is it safe to disable the Spooler service?

If you don’t have any physical printers attached to your computer and you and never plan to do any printing, you can safely disable the Spooler service.

However, watch out for applications that silently use the printing API. They will also fail when the service is disabled.

What should I do if the Spooler service isn’t working?

If the Spooler is misbehaving, you should restart it. You can do so from the Services Control Panel application, or by running a couple of NET commands:

NET STOP Spooler
NET START Spooler

Be sure to run those commands from an elevated command prompt, otherwise they will fail with permissions errors.

I made a mistake. How do I cancel all printing?

To clear all printing, open the printer queue (see above) and select Cancel All Documents from the Printer menu:.

Select Cancel All Documents

Give the Spooler (and your printer) a few seconds to respond to the request.

Canceling didn’t work. Is there another way to clear out all pending documents?

Try running this sequence of commands to stop the Spooler, remove all files from the print queue, and restart the service. You will need to have admin rights:

NET STOP Spooler
DEL /Q /F /S C:\Windows\System32\spool\PRINTERS\*
NET START Spooler

The Spooler service won’t start (Error 1053)

As reported in Microsoft’s technical forum, the problem may be with “desktop interaction” — an obscure windows service setting.

To fix the issue:

  1. Open the Spooler service (from the Services Control Panel application)
  2. Switch to the Log On tab
  3. Un-check the Allow service to interact with desktop box:
    Un-check interact with desktop
  4. Click OK to save your change.

Afterwards, you should be able to start the service.

The Spooler service is stuck in the “Stopping” state — Help!

In that unusual situation, find and terminate the spoolsv.exe process from the Task Manager (admin rights required):

Task Manager: Terminate spoolsv.exe

The service should transition to the stopped state.

The Spooler service keeps stopping for no reason. How do I keep it running?

Our Service Protector utility may be able to help. Please follow this step-by-step tutorial showing how to protect the Spooler service.

Questions? Problems?

If you would like to know more about the Windows Print Spooler service, or you have a specific problem, please feel free to get in touch. We will do our best to help you!

Posted in Windows Services | Tagged , , , , , | 3 Comments