Windows Service does not start automatically on Windows 7 - windows-services

I made a Windows Service application, set its properties to start automatically, using system account.
Windows 10 behavior: Starts as expected. On every system restart.
Windows 7 behavior: Does not start. No error / warning message in any log. Can be started by administrative user. Starts immediately.
I would understand an error occurs when the system is trying to start the service, but then again where's the log entry? Why the service can be started manually? Then, what's the weirdest part here: why does it work on Windows 10?
BTW, my service's OnStart is empty except base.OnStart(args).
The only log entry I get is System log:
A timeout was reached (30000 milliseconds) while waiting for the MY_SERVICE to connect.
Important fact: The service starts when set to "Delayed Start". But this is not acceptable for me. The service is to be started ASAP, "Delayed Start" occurs way too late for my needs.
How to make my service compatible with Windows 7, what may be the possible cause of service not starting automatically on Windows 7, but staring correctly on Windows 10?
My service uses .NET Framework 4.6.1 and it is installed on my test Windows 7 VM.

Related

Problem in running cen/xfs client application as windows service

I'm developing a cen/xfs client application in c++ which will register for the events and receive it. I installed the application (.exe file) as a windows service and the system is rebooting after few minutes once i started the service, but when i execute the .exe file directly it works properly. Anyone know why?

MobileFirst Server 7.0.0 as service on Windows Server 2012 not recognizing runtime environments

We are encountering a problem running the MobileFirst Enterprise Server on Windows Server 2012 R2. When we start using a batch file as Administrator, as long as we stay remote connected the server is working OK, we see the Runtime Environments. But when we log out, server is unreachable. We created a Windows Service that starts the server with same command:
*sc create WASLibertyV85 binPath= "C:\Program Files\IBM\WebSphere\Liberty\bin\server.bat start worklight" DisplayName="IBM WebSphere Liberty V8.5 Worklight" start=auto*
But the Runtime is not displayed, we only see:
No runtime environment deployed in this server.
Is there a way to enable MobileFirst Server seeing the Runtime Environments when was started as service?
Here's our complete solution:
1. Start CMD as administrator and run this:
sc create WASLibertyV85 binPath= "C:\Program Files\IBM\WebSphere\Liberty\bin\server.bat start worklight" DisplayName="IBM WebSphere Liberty V8.5 Worklight" start=delayed-auto
2. under Services.msc open the properties of the „IBM WebSphere Liberty V8.5 Worklight“ service and set this (if not already):
Tab GENERAL -> Startup type: Automatic (Delayed Start)
Tab LOG ON -> Log on as: Local System account + Allow service to interact with desktop
++ When the server restarts, it can take up to 2 minutes, until the runtimes are displayed in the Worklight Console!++
MFP is not being run as a service. MFP is simply a web app (a .war file, a .jar file and some artifacts) running on-top of WebSphere Liberty, in your case. So all of this is related only to Liberty and not to MFP.
As long as the Liberty instance is launched correctly, it should handle everything on its own, including the web apps that are deployed to it, MFP being one of them.
You could perhaps follow the instructions provided in this forum topic explaining how to use Apache Commons Daemon to run Liberty as a Windows service. There are other tools that can do this as well.
The problem was cause by starting the service with a log on account set as current windows user. When we've chaged to Local System Account and enabled Allow system to interact with desktop, the Runtime became visible on MobileFirst Server.

Troubleshoot windows error: Failed to schedule Software Protection service for re-start at 2014-09-13T08:09:23Z. Error Code: 0x80040154

My setup:
Opertaing System: Windows 8.1
Memory: 16GB
HD: 500GB
etc. non relevant.
Issue:
I noticed the issue when my printer stopped working after a normal restart. At that point I tried to uninstall and reinstall the printer driver. The install failed.
At that point I also realized all my remote desktop connections were also failing, with not being able to find the remote host.
Here is the error I was seeing when install for the printer was failing:
can't start printer spooler service not enough resources are available to start the service
Manually trying to start the spooler service and checking in the event Viewer of windows showed that it was failing on:
Failed to schedule Software Protection service for re-start at 2014-09-13T08:09:30Z. Error Code: 0x80040154.
Further trying to restart the protection service revealed that it was failing on:
Task Scheduler service has encountered RPC initialization error in "RpcServerUseProtseq:ncacn_ip_tcp". Additional Data: Error Value: 1721.
In either case my computer had become somewhat useless as I couldn't install anything and my printer and remote desktop was broken too.
Reporting the problem just in case if someone has a similar issues.
The resolution for my problem is actually posted here, but way back so bringing it to more light:
http://social.technet.microsoft.com/Forums/windows/en-US/0c438376-1486-4ae4-9847-2de7a8767f27/task-scheduler-service-has-encountered-rpc-initialization-error-in?forum=itprovistasp
For me what worked was just to starting the prompt in adminstrator mode, running:
netsh winsock reset
and restarting my machine.
Not exactly certain of what actually fixed the issue.

Rails server will not stop and even if it is running it is not working

I am new to Ruby on Rails, but I managed to install it using the RailsInstaller and I am using Aptana Studio 3 as a text editor. I am on a Windows 7 x64.
Last week I managed to create a simple Hello world project, and it worked as it should when starting and stopping the rails server. To start the server I used the command rails server and to stop it I used CTRL+C.
Somehow, this week, when I'm trying to start the server it says "A server is already running". But, when I go to the correct page in a web browser it doesn't work. I get the error "Google Chrome could not connect to localhost:3010". So, this makes it seem like the server is not working, even though it supposedly is running.
So, I then try to stop the server from running, but CTRL+C doesn't seem to do anything. It doesn't give any kind of message at all when I input that, it just skips to a new line in the terminal window.
the standard port is 3000.
You can kill the server in the task manager and start it from new..
There is probably a rails process still running but bugged out/crashed. Try looking at the processes in the windows task manager to for a rails process, and cancel it. Additionally you can start a rails process on a different port with rails server -p PORT

Error attaching debugger to IIS worker process

I have a strange problem in that my MVC Azure application is running/debugging on my desktop but not my laptop. On the laptop I get an error
Error attaching debugger to IIS worker process
However I don't get the problem when running/debugging a simpler/smaller MVC Azure project on the laptop. The only difference between the laptop and desktop is that the laptop is running Windows 8. A prior version of the application did run on the laptop but has suddenly stopped working and I can't trace back why.
Has anyone got any ideas as to what the cause could be.
Can you use TcpView(http://technet.microsoft.com/en-us/sysinternals/bb897437.aspx) to see if there is a port conflict on the machine with the port used by IIS Express

Resources