windows-services

Handling delays during stop/pause requests on Windows service

我与影子孤独终老i 提交于 2019-12-04 13:13:20
I have a Windows service class deriving from ServiceBase that uses a System.Timers.Timer to run code at frequent intervals. The handlers for OnStop and OnPause use some signalling with the timer thread to check if the timer is still running and waits for it to finish. Is there a recommended way of handling delay errors in this situation, such as if the handler is waiting for an unacceptably long time for the timer thread to stop? Should I just continue waiting until the SCM gives up (but that will put the service into a state where you can't do anything with the service except kill the process

jenkins service fail to start on windows 2008

烈酒焚心 提交于 2019-12-04 12:48:00
I'm trying to get Jenkins installed as a service on a Windows Server 2008 Datacenter (SP2). I can't seem to get it to run as a service and am looking for any ideas to help get it going. When I try install Jenkins with native Windows package I get "Error 1920. Service Jenkins failed to start." in msiexec logs. I've performed the following steps for manual installation: Installed java 32 bit Started Jenkins with java -jar jenkins.war Gone to Manage Jenkins and set it to run as a Windows Service. Told Jenkins to restart itself as a service. At this point, Jenkins dies and doesn't come back up.

Windows service that will run every hour

我是研究僧i 提交于 2019-12-04 12:13:09
问题 I m able to build a windows service and install it. I m curious how can i run this service every hour ? I want it to run every hour periodically. I also need to know the hour range that it s running so that I can store it somewhere. How can i do that? Edit : This service will be installed on many machines, therefore, I dont want to create a scheduled task say on 100 servers. 回答1: If you want a task to run on a regular interval as opposed to constantly, you should look into using the Task

Custom Command Windows Services on HIGH Priority

让人想犯罪 __ 提交于 2019-12-04 12:08:28
I have an Work Tracker WPF application which deployed in Windows Server 2008 and this Tracker application is communicating with (Tracker)windows service VIA WCF Service. User can create any work entry/edit/add/delete/Cancel any work entry from Worker Tracker GUI application. Internally it will send a request to the Windows service. Windows Service will get the work request and process it in multithreading. Each workrequest entry will actually create n number of work files (based on work priority) in a output folder location. So each work request will take to complete the work addition process.

Heartbeat activity for Windows Service

假如想象 提交于 2019-12-04 12:07:18
I have many Windows Services (written in C# 4.0) that at various intervals connect to a database and do various complex tasks. Some of these tasks only occur every X hour intervals per day. However, the server support team would like to know if the Windows Service is actually running as there can be a big interval between tasks. They would like essentially a heartbeat for each Windows Service. Every 5 minutes the Windows Service would do something that could be monitored by Microsoft System Center Operation Manager (SCOM). Any solution must being easily monitored by SCOM as the server support

Service does not start

☆樱花仙子☆ 提交于 2019-12-04 12:05:17
问题 I created a Windows service with Delphi and used two method to install, start and stop. Method 1 if i install this service using commandline C:\MyService\ServiceApp.exe /Install it installed successfully and i can start and stop too in the service console. Method 2 but if i install the same service with different name using sc e.g. C:\Windows\system32>sc create myservice binpath= c:\MyService\ServiceApp.exe I see it is installed but i can not start the service using service console as well as

Can a service be started by normal user on Windows?

旧巷老猫 提交于 2019-12-04 12:03:54
I have a service application created with Delphi, and managed to install it from another Delphi application using elevated privileges. The service is set to log on as the Local System account (which is default when creating a service application in Delphi). I have another Delphi application in which an ordinary user is supposed to be able to start or stop the above service. My question is: Is this allowed by Windows? When I try to start the service using code in Delphi, it just fails with 'Code 5. Access is denied.' How can I prevent this error from occurring? I want to be able to have the

Getting server restart count in a day using c#?

拜拜、爱过 提交于 2019-12-04 11:52:22
Is it possible to get the number of times a server gets restarted in a period of time using c#? I have seen this post which is getting windows last shutdown time Get the date-time of last windows shutdown event using .NET Any suggestion? Have you considered reading from the server's event log? The 'USER32' system event source records shutdowns. From what I've read it seem that you should be able to read a remote machine's event log programmatically as well ( See How to manage event logs using Visual C# .NET or Visual C# 2005 ) EDIT The following console app will work on querying the even log

How do you register a Windows Service during installation?

余生颓废 提交于 2019-12-04 11:45:16
I have built a windows service application in VB.net 2008, and used the Setup Wizard to add an installation process. The installer works, in that it adds the app to add/remove programs and copies all of the files etc, but it's missing the final (required) step of actually installing the service. I have added the primary output of the Project as a custom action for Install and Uninstall, without success. what's the secret? You need to create a custom install task; MSDN has everything you need to know You can do two things: 1) Use custom actions in your setup project to register the service

Windows Service Hosted TCP WCF Service

﹥>﹥吖頭↗ 提交于 2019-12-04 11:36:59
I am trying to host a WCF service on a windows 2008 R2 server as a windows service. I followed the directions provided by msdn ( found here ). Everything works fine as long as everything is part of the same solution in visual studio. However, I tried creating a client in a different solution (on the same machine) and it can't find the service. I get an 'Add Service Reference Error' shown below. My goal is to be able to access the wcf service remotely, but I can't seem to even access it locally unless the client was created within the same client. Is there any guides, tutorials, or helpful