The Core Technologies Blog

Professional Software for Windows Services / 24×7 Operation



Q&A: Why can’t AlwaysUp Open the Netman Service?

Why can't AlwaysUp Open the Netman Service?
  Hi Team,

AlwaysUp can start Thunderbird as a Windows Service and it runs without any problems. But I always get the following warnings:


Unable to ensure that networking components are running: Netman: Unable to open the service: Zugriff verweigert. AlwaysUpService will pause for a few seconds and try again.

Unable to ensure that networking components are running: Netman: Unable to open the service: Zugriff verweigert.

(“Zugriff verweigert” means “Access denied” in English.)

Thunderbird is running as a NON-admin-user on this server.

Is there a way to stop these warnings, or should I just ignore them?

— Oliver

Hi Oliver, thanks for reaching out.

It’s your choice how to handle the warnings. You can ignore the messages because they don’t impact Thunderbird. Or with a few small changes, you can eliminate them altogether. Let’s dig into the details.

Why your Thunderbird service generates the “Access denied” warning

Windows reports the “access denied error” whenever someone tries to perform an operation that they are not allowed to. Think of it as Windows saying “no, you can’t do that”.

In your case, the message is reported because the account you have specified on the AlwaysUp Logon tab doesn’t have enough rights to open the Network Connections (Netman) Windows Service.

That is not a surprise. As you mentioned, you are running Thunderbird as a non-administrative user. And typically, only administrators have access to core services like Netman.

We have investigated this situation with other customers before. Each time, we concluded that the warning could be ignored. That’s because Netman — which handles client network configuration — was already running by the time AlwaysUp started.

However, we also have a couple of solutions for you if ignoring the warnings isn’t good enough.

Solution #1: Delay startup instead of checking the network

Since Thunderbird communicates over the network, it’s good to have AlwaysUp confirm that the network is up before it launches the application. If not, Thunderbird could start too soon and fail.

In those situations, we recommend checking the Ensure that the Windows networking components have started box on the Startup tab:

Ensure that the Windows networking components have started

However, when that box is checked, AlwaysUp tries to open the Netman service. And that is precisely what fails in your case!

So let’s think outside the box. Since AlwaysUp cannot directly wait for the network to start, instead let’s delay AlwaysUp to give the networking components enough time to start.

To do that:

  1. Uncheck the Ensure that the Windows networking components have started box on the Startup tab

  2. On the General tab, choose Automatically, but shortly after the computer boots in the Start the application field:

    Start your application shortly after boot
  3. Save your changes.

With that adjustment in place, Windows will start your Thunderbird Windows Service about 2 minutes after your computer boots. Netman (and other critical services) should definitely be running by then.

Solution #2: Grant your non-admin user rights to the Network Connections Windows Service

If delaying Thunderbird at boot is not acceptable, you can take direct action on the Netman service instead. By allowing your non-admin user to check the Netman service, you can avoid the annoying “access denied” message altogether.

To update Netman’s permissions:

  1. Download our free Service Security Editor utility

  2. Start Service Security Editor

  3. Select Network Connections from the drop-down list and click Open:

    Open Network Connections service
  4. In the Service Security Settings window, add the non-admin user and grant them the Read permission (at minimum):

    Update Netman service security settings
  5. Click OK to save your changes.

And now that your non-admin user has permission to check the state of the Network Connections service, you won’t see the warning anymore.

Happy emailing!

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

Q&A: Why does AlwaysUp Think my Application Stopped?

Why does AlwaysUp Think my Application Stopped?
  Dear AlwaysUp support,

We frequently get the following warning:

AlwaysUpService has detected that the application has stopped.

However, in the logs of our application we can’t see anything pointing to the reason why the application stopped.

Why does AlwaysUp believe our application stopped? What is the criteria for the decision, that an application is considered as stopped?

Our application handles complex tasks. When it’s very busy, it might appear to hang. Could that be a reason for AlwaysUp to say it stopped?

I am pretty sure the process — normally visible in Task Manager — is not stopped, but I’m not 100% sure and I can not prove it. I am wondering if AlwaysUp might close the app by mistake.

— Adrian

Hi Adrian.

Don’t worry! With a little detective work, we should be able to figure out what’s going on.

But first, let’s review how AlwaysUp monitors your application.

How AlwaysUp determines that your application stopped

After AlwaysUp launches your application as a service, it’s primary task is to watch your application and ensure that it’s always running. As such, AlwaysUp performs a battery of tests every few seconds to detect if your application is in trouble.

The most important check involves the state of your application’s process. But what is a process?

When Windows runs your application, it creates a process to track that specific instance of your running application. That process has an identifier (ID) and is visible on the “Details” tab in the Task Manager.

For example, process 9088 was created after we opened Notepad on our desktop:

Task Manager: Notepad Process

And when we quit Notepad, process 9088 exited and disappeared from Task manager’s list.

Basically, a process tracks the lifetime of a running application. And everything running on your computer has at least one underlying process.

With that in mind, let’s return to AlwaysUp.

When AlwaysUp launches your application, Windows creates a process and returns it to AlwaysUp. Going forward, every two seconds, AlwaysUp asks Windows if the process is still alive or not. You can think of it like AlwaysUp opening the Task Manager and checking if the process is still on the list.

So when AlwaysUp says that your application has stopped, it’s because the application’s process is no longer active. In effect, the process has fallen off Task Manager’s list.

Investigate with Process Explorer

Have you ever used Microsoft’s free Process Explorer? It’s an amazing tool that can help you figure out what’s running on your machine — and why. Around here, we call it “Task Manager on steroids”. 🙂

Download Process Explorer and extract the zip file to your hard drive. We’ll need it for the next steps.

Dig into the tree of processes under AlwaysUp

Start Process Explorer. It will show all the applications running on your computer.

The leftmost Process column displays the hierarchical relationships between the processes. For example, if “Process A” started “Process B”, you will see “Process B” as a child of “Process A”. “Process B” will be displayed underneath “Process A”.

Now, let’s roll up our sleeves. If you haven’t already done so, please start your application in AlwaysUp. Afterwards, switch back to Process Explorer.

In the Process column, find AlwaysUpService.exe. That is the part of AlwaysUp that runs your application as a Windows Service. It will be a child of services.exe — the Windows Services Control Manager.

Your application should appear under AlwaysUpService.exe. For example, you can see that parent-child relationship when AlwaysUp is running Microsoft OneDrive as a service:

Process Explorer: AlwaysUp running OneDrive

Does your application appear as a child of AlwaysUpService.exe?

Are other processes displayed in the tree as well?

Is this a “launcher” situation, where the application you provided to AlwaysUp starts another program and exits?

Look for anything unusual that may trick AlwaysUp into thinking that your application has stopped even though it’s still running.

Find out when your application started

If you think that your application hasn’t stopped, you should confirm that hypothesis with Process Explorer. Double-click your application’s entry to bring up the Properties window and look for the Started field.

For example, Process Explorer tells us that AlwaysUp last started OneDrive at 12:21:32 PM on March 27 2022:

Process Explorer: OneDrive start time

If everything is working as expected, the start time should be close to the time reported in the AlwaysUp logs. Please be sure to let us know if the times are different because that would indicate a bug in AlwaysUp.

Best of luck with your application!

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

Essential Windows Services: Security Accounts Manager / SamSs

Security Accounts Manager Service

What is the Security Accounts Manager (SamSs) service?

The Security Accounts Manager service administers the database of user and group account information stored on your computer. The service helps to authenticate local and remote users logging on to your PC.

The service’s display name is SamSs and it’s hosted in the LSA process, lsass.exe. By default, the service is set to start automatically when your computer boots:

Security Accounts Manager Windows Service

What happens if I stop SamSs?

The following services depend on SamSs:

SamSs Service dependencies

That means that if you stop SamSs, those services will stop as well. And that may cripple your computer.

For example, if the Server service stops, file and printer sharing won’t work. Are those features important to you?

In any case, you may find it next to impossible to stop the SamSs service!

You will notice that the stop button is disabled in the Services application:

SamSs stop button disabled

And the SC command informs us that the service is not stoppable, cannot be paused and ignores shutdown requests:

SC Query SamSs

Apparently Microsoft really doesn’t want anyone to disturb the Security Accounts Manager service!

Is it OK to disable the Security Accounts Manager service?

The service’s description states:

 Disabling this service will prevent other services in the system from being notified when the SAM is ready, which may in turn cause those services to fail to start correctly. This service should not be disabled.

Indeed, Microsoft reiterates their recommendation to keep the service enabled on Windows Server 2016 (with Desktop Experience).

What happens if I kill the SamSs process (lsass.exe)?

The Security Accounts Manager service runs inside the lsass.exe process, which multiple services may share.

For example, here you see three services — SamSs, VaultSvc (Credential Manager), and Keyslo (CNG Key Isolation) — all running in the same instance of lsass.exe (with PID 708):

lsass.exe is running multiple services

Because all three services are running in the same process, terminating the process will stop all three services.

That’s probably OK for the CNG Key Isolation service but Credential Manager is a building block for another three services. Be sure to understand the implication of terminating the Credential Manager service before killing the shared lsass process.

The SamSs service isn’t starting. Help!

If Security Accounts Manager failed to start, it is likely that the important Remote Procedure Call (RPC) service didn’t start either.

Open Services and check if someone has disabled the RPC service. If so, you should definitely re-enable it.

After that, try to start the RPC service. If that works, you can start SamSs next.

Questions? Problems?

If you would like to know more about the Security Accounts Manager 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 , , , , | 2 Comments

AlwaysUp 13.3 Introduces Log File Rollover and Expands the use of Variables

AlwaysUp 13.3 is available now

AlwaysUp version 13.3 was released to all customers on April 16, 2022.

This update delivers a couple of significant improvements to help you run your programs as Windows Services — unattended and 24/7.

AlwaysUp accepts special variables in the “Arguments” and “Start in” fields

Do you run many instances of a single executable with AlwaysUp?

And does each application’s configuration follow a predictable format?

If so, you may be able to use special variables when defining your applications.

For example, let’s take the case of the Alpha Five web server. It’s common for customers to run multiple instances of Alpha in AlwaysUp, each with its own configuration.

In those situations, each entry in AlwaysUp will point to the same executable — A5ApplicationServer.exe. However, each instance will specify its own configuration file in the “Arguments” field.

Here is what it looks like when creating an instance of Alpha Five in AlwaysUp:

Alpha Five server configuration

Since the name of the configuration file (C:\AlphaFive\Server1-config.xml) is based on the entry’s name in AlwaysUp (Server1), we can use the $ALWAYSUP_NAME variable in the “Arguments” field instead:

Alpha Five server configuration using a variable

Using a variable like that reduces errors and saves a few keystrokes when duplicating the entry. And that can come in very handy when you have to create and manage many instances!

By the way, you can check out the full list of variables on page 78 of the AlwaysUp User’s Manual.

AlwaysUp can roll over log files when capturing your console application’s output

If you’re running a console application as a Windows Service with AlwaysUp, you may already know about the option to capture output to a file. That setting is available on the Extras tab.

In previous releases, the only option to limit the file’s size was by trimming. When the file grew larger than the given threshold, AlwaysUp would discard the oldest 25% of the file to make room for new entries. As such, there was no way retain all console output while limiting the file’s size.

To address that shortcoming, AlwaysUp now supports rollover when the file gets too large. When the rollover option is enabled, AlwaysUp will copy a too-large log file to a name suffixed with the current date and restart capture with an empty file.

For example, let’s say you’re logging to a file named “console-output.log” and limiting the size to 10 MB. And on April 20, 2022, the file exceeds the threshold. In response, AlwaysUp will:

  1. Copy the file to “console-output_2022-04-20.log”, to preserve all entries recorded so far;

  2. Zero out “console-output.log” and start writing new entries there.

Note that if there are many rollovers in a single day, AlwaysUp will add numeric suffix to produce a unique file name. That may result in files named “console-output_2022-04-20_01.log” or “console-output_2022-04-20_02.log” in the situation above.

You can activate the rollover option on the Extras tab. Check the Capture output… and Automatically… boxes and choose rollover from the selector:

AlwaysUp: Log file rollover

Other fixes & improvements

As usual, please review the release notes for the full list of features, fixes and improvements included in this release.

Upgrading to AlwaysUp 13.3

If you purchased AlwaysUp version 12 (after March 2020), you can upgrade to any version 13 for free. Simply download and install “over the top” to preserve your existing applications and all settings. Your registration code will continue to work as well.

If you bought AlwaysUp version 11 or earlier (before March 2020), you will need to upgrade to use version 13. Consequently, please purchase upgrades here — at a 50% discount.

Please see the upgrade policy for full details.

Enjoy!

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